OSDN Git Service

Fix up some of the sample to work with the r200 EGL driver
authorJon Smirl <jonsmirl@gmail.com>
Sun, 7 Aug 2005 02:15:27 +0000 (02:15 +0000)
committerJon Smirl <jonsmirl@gmail.com>
Sun, 7 Aug 2005 02:15:27 +0000 (02:15 +0000)
progs/egl/demo3.c
progs/egl/eglgears.c
progs/egl/eglinfo.c

index 6c73584..2693c37 100644 (file)
@@ -576,7 +576,7 @@ main(int argc, char *argv[])
    /*
    EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    */
-   EGLDisplay d = eglGetDisplay("!fb_dri");
+   EGLDisplay d = eglGetDisplay(":0");
    assert(d);
 
    if (!eglInitialize(d, &maj, &min)) {
@@ -602,7 +602,7 @@ main(int argc, char *argv[])
       printf("failed to create screen surface\n");
       return 0;
    }
-   
+
    eglShowSurfaceMESA(d, screen, screen_surf, mode);
 
    b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
@@ -610,25 +610,24 @@ main(int argc, char *argv[])
       printf("make current failed\n");
       return 0;
    }
+   glViewport(0, 0, 1024, 768);
+
 
-   Init();   
+   Init();
    Reshape(1024, 768);
 
-   glDrawBuffer( GL_FRONT ); 
-   glClearColor( 0, 
-                1.0, 
-                0,
-                1);
+   glDrawBuffer( GL_FRONT );
+   glClearColor( 0, 1.0, 0, 1);
 
-   glClear( GL_COLOR_BUFFER_BIT ); 
+   glClear( GL_COLOR_BUFFER_BIT );
 
-   doubleBuffer = 1;   
-   glDrawBuffer( GL_BACK ); 
+   doubleBuffer = 1;
+   glDrawBuffer( GL_BACK );
 
    Draw(d, screen_surf);
-   
+
    write_ppm("dump.ppm", ((struct fb_display *)_eglLookupDisplay(d))->pFB, 1024, 768);
-   
+
    eglDestroySurface(d, screen_surf);
    eglDestroyContext(d, ctx);
    eglTerminate(d);
index bd78353..0c3da56 100644 (file)
@@ -87,9 +87,9 @@ static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
 static GLint gear1, gear2, gear3;
 static GLfloat angle = 0.0;
 
-static GLfloat eyesep = 5.0;           /* Eye separation. */
-static GLfloat fix_point = 40.0;       /* Fixation point distance.  */
-static GLfloat left, right, asp;       /* Stereo frustum params.  */
+//static GLfloat eyesep = 5.0;         /* Eye separation. */
+//static GLfloat fix_point = 40.0;     /* Fixation point distance.  */
+//static GLfloat left, right, asp;     /* Stereo frustum params.  */
 
 
 /*
@@ -385,7 +385,7 @@ main(int argc, char *argv[])
        }
        
        // DBR : Create EGL context/surface etc
-       EGLDisplay d = eglGetDisplay("!fb_dri");
+       EGLDisplay d = eglGetDisplay(":0");
        assert(d);
 
        if (!eglInitialize(d, &maj, &min)) {
@@ -431,7 +431,9 @@ main(int argc, char *argv[])
        
        init();                 // Initialise the GL visual
        reshape(1024,768);
-       
+
+   glDrawBuffer( GL_BACK );
+
        // DBR : Run the simulation
        run_gears(d, screen_surf, 5.0);
        
index 7d71640..4826fd0 100644 (file)
@@ -136,7 +136,7 @@ main(int argc, char *argv[])
 {
    int maj, min;
    /*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/
-   EGLDisplay d = eglGetDisplay("!fb_dri");
+   EGLDisplay d = eglGetDisplay("!r200_dri");
 
    if (!eglInitialize(d, &maj, &min)) {
       printf("eglinfo: eglInitialize failed\n");