Flicker Errors while blending OpenGL and SDL

Alright, I got this code working, now could someone please tell me why on earth my screen looks like it kind of flickers, but more like its running at the wrong refresh or something? any takers?

PS ESC key is used to exit program.

I linked opengl32.lib, glu32.lib, SDL.lib, and SDLmain.lib

#include <windows.h>
#include <SDL.h>
#include <gl\gl.h>
#include <gl\glu.h>

void SetupRC();
void ChangeSize(int, int);
void RenderScene();
void InputHandler();
void HandleKeyboardEvent(SDL_Event *event);
void HandleMouseEvent(SDL_Event *event);

int main(int argc, char* argv[])
{
const SDL_VideoInfo* info = NULL;
int w = 0;
int h = 0;
int bpp = 0;
int flags = 0;

SDL_Init( SDL_INIT_VIDEO );
info = SDL_GetVideoInfo( );

w = 640;
h = 480;

bpp = info->vfmt->BitsPerPixel;

SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

flags = SDL_OPENGL | SDL_FULLSCREEN;

SDL_SetVideoMode( w, h, bpp, flags );

ChangeSize( w, h );

SetupRC();

while( 1 )

{

    InputHandler( );
    RenderScene( );
}

return 0;

}

void RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();

glBegin(GL_TRIANGLE_STRIP);
glNormal3f(-0.9f, -0.5f, -0.2f);
glVertex3f(0.0f, 0.0f, -10.0f);
glVertex3f(2.0f, 0.0f, -10.0f);
glVertex3f(1.0f, 2.0f, -10.0f);
glNormal3f(-0.9f, -0.3f, 0.1f);
glVertex3f(3.0f, 4.0f, -20.0f);
glEnd();

glPopMatrix();
SDL_GL_SwapBuffers( );
}

void SetupRC()

{
float ambient0[] = {0.3f, 0.3f, 0.3f, 1.0f};
float diffuse0[] = {0.7f, 0.7f, 0.7f, 1.0f};
float specular0[] = {0.8f, 0.8f, 0.8f, 1.0f};
float specref0[] = {0.8f, 0.8f, 0.8f, 1.0f};

glEnable(GL_DEPTH_TEST);
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);

glLightfv(GL_LIGHT0,GL_AMBIENT,ambient0);
glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse0);
glLightfv(GL_LIGHT0,GL_SPECULAR,specular0);
glEnable(GL_LIGHT0);

glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

glMaterialfv(GL_FRONT, GL_SPECULAR, specref0);
glMateriali(GL_FRONT, GL_SHININESS, 100);

glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glColor3f(1.0f, 0.0f, 0.0f);
}

void ChangeSize(int w, int h)

{

float lightpos0[] = {-50.0f, 50.0f, 100.0f, 1.0f};
glLightfv(GL_LIGHT0, GL_POSITION, lightpos0);

float fAspect;

if(h==0)
h=1;

glViewport(0,0,w,h);
fAspect = (float)w/(float)h;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

gluPerspective(45.0f, fAspect, 1.0f, 400.0f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

}

void InputHandler()

{
SDL_Event event;

while(SDL_PollEvent(&event))
{
switch(event.type)
{
case SDL_KEYDOWN:
case SDL_KEYUP:
HandleKeyboardEvent(&event);
break;

case SDL_MOUSEMOTION:
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
HandleMouseEvent(&event);
break;
}
}
}

void HandleKeyboardEvent(SDL_Event *event)
{
SDL_KeyboardEvent *key=&event->key;

switch(key->type)
{
case SDL_KEYUP:

switch(key->keysym.sym)
{
case SDLK_ESCAPE:
break;

default:
break;
}

case SDL_KEYDOWN:

switch(key->keysym.sym)
{
case SDLK_ESCAPE:
exit(0);
break;

default:
break;
}

default:
break;
}
}

void HandleMouseEvent(SDL_Event *event)
{
SDL_MouseMotionEvent *motion=&event->motion;
SDL_MouseButtonEvent *button=&event->button;

switch(event->type)
{
case SDL_MOUSEMOTION:
break;
case SDL_MOUSEBUTTONDOWN:
break;
case SDL_MOUSEBUTTONUP:
break;

default:
break;
}
}

What video card are you using?

Try:
bool x = glGetBooleanv(GL_DOUBLEBUFFER);
Too see if you support double buffering.

Vince~----- Original Message -----
From: Alan Ide
To: sdl at libsdl.org
Sent: Monday, September 17, 2001 10:32 PM
Subject: [SDL] Flicker Errors while blending OpenGL and SDL

Alright, I got this code working, now could someone please tell me why on earth my screen looks like it kind of flickers, but more like its running at the wrong refresh or something? any takers?

PS ESC key is used to exit program.

I linked opengl32.lib, glu32.lib, SDL.lib, and SDLmain.lib

#include <windows.h>
#include <SDL.h>
#include <gl\gl.h>
#include <gl\glu.h>

void SetupRC();
void ChangeSize(int, int);
void RenderScene();
void InputHandler();
void HandleKeyboardEvent(SDL_Event *event);
void HandleMouseEvent(SDL_Event *event);

int main(int argc, char* argv[])
{
const SDL_VideoInfo* info = NULL;
int w = 0;
int h = 0;
int bpp = 0;
int flags = 0;

  SDL_Init( SDL_INIT_VIDEO );
  info = SDL_GetVideoInfo( );

  w = 640;
  h = 480;

  bpp = info->vfmt->BitsPerPixel;

  SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
  SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
  SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
  SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
  SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

  flags = SDL_OPENGL | SDL_FULLSCREEN;

  SDL_SetVideoMode( w, h, bpp, flags );
  
  ChangeSize( w, h );

SetupRC();

  while( 1 )

{

      InputHandler( );
      RenderScene( );
  }

  return 0;

}

void RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();

glBegin(GL_TRIANGLE_STRIP);
glNormal3f(-0.9f, -0.5f, -0.2f);
glVertex3f(0.0f, 0.0f, -10.0f);
glVertex3f(2.0f, 0.0f, -10.0f);
glVertex3f(1.0f, 2.0f, -10.0f);
glNormal3f(-0.9f, -0.3f, 0.1f);
glVertex3f(3.0f, 4.0f, -20.0f);
glEnd();

glPopMatrix();
SDL_GL_SwapBuffers( );
}

void SetupRC()

{
float ambient0[] = {0.3f, 0.3f, 0.3f, 1.0f};
float diffuse0[] = {0.7f, 0.7f, 0.7f, 1.0f};
float specular0[] = {0.8f, 0.8f, 0.8f, 1.0f};
float specref0[] = {0.8f, 0.8f, 0.8f, 1.0f};

glEnable(GL_DEPTH_TEST);
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);

glLightfv(GL_LIGHT0,GL_AMBIENT,ambient0);
glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse0);
glLightfv(GL_LIGHT0,GL_SPECULAR,specular0);
glEnable(GL_LIGHT0);

glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

glMaterialfv(GL_FRONT, GL_SPECULAR, specref0);
glMateriali(GL_FRONT, GL_SHININESS, 100);

glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glColor3f(1.0f, 0.0f, 0.0f);
}

void ChangeSize(int w, int h)

{

float lightpos0[] = {-50.0f, 50.0f, 100.0f, 1.0f};
glLightfv(GL_LIGHT0, GL_POSITION, lightpos0);

float fAspect;

if(h==0)
h=1;

glViewport(0,0,w,h);
fAspect = (float)w/(float)h;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

gluPerspective(45.0f, fAspect, 1.0f, 400.0f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

}

void InputHandler()

{
SDL_Event event;

while(SDL_PollEvent(&event))
{
switch(event.type)
{
case SDL_KEYDOWN:
case SDL_KEYUP:
HandleKeyboardEvent(&event);
break;

case SDL_MOUSEMOTION:
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
 HandleMouseEvent(&event);
 break;
}

}
}

void HandleKeyboardEvent(SDL_Event *event)
{
SDL_KeyboardEvent *key=&event->key;

switch(key->type)
{
case SDL_KEYUP:

switch(key->keysym.sym)
{
 case SDLK_ESCAPE:
  break;

 default:
  break;
}


case SDL_KEYDOWN:

switch(key->keysym.sym)
{
 case SDLK_ESCAPE:
  exit(0);
  break;

 default:
  break;
}

default:
 break;

}
}

void HandleMouseEvent(SDL_Event *event)
{
SDL_MouseMotionEvent *motion=&event->motion;
SDL_MouseButtonEvent *button=&event->button;

switch(event->type)
{
case SDL_MOUSEMOTION:
break;
case SDL_MOUSEBUTTONDOWN:
break;
case SDL_MOUSEBUTTONUP:
break;

default:
 break;

}
}

I am using a voodoo 5500 agp, so i am pretty sure that i can handle double buffering. Any other suggestions? My syntax is right, is there a performance call i missed somewhere?----- Original Message -----
From: Vince
To: sdl at libsdl.org
Sent: Monday, September 17, 2001 6:24 PM
Subject: Re: [SDL] Flicker Errors while blending OpenGL and SDL

What video card are you using?

Try:
bool x = glGetBooleanv(GL_DOUBLEBUFFER);
Too see if you support double buffering.

Vince~

----- Original Message ----- 
From: Alan Ide 
To: sdl at libsdl.org 
Sent: Monday, September 17, 2001 10:32 PM
Subject: [SDL] Flicker Errors while blending OpenGL and SDL


Alright, I got this code working, now could someone please tell me why on earth my screen looks like it kind of flickers, but more like its running at the wrong refresh or something? any takers?

PS ESC key is used to exit program.

I linked opengl32.lib, glu32.lib, SDL.lib, and SDLmain.lib 

#include <windows.h>
#include <SDL.h>
#include <gl\gl.h>
#include <gl\glu.h>

void SetupRC();
void ChangeSize(int, int);
void RenderScene();
void InputHandler();
void HandleKeyboardEvent(SDL_Event *event);
void HandleMouseEvent(SDL_Event *event);

int main(int argc, char* argv[])
{
    const SDL_VideoInfo* info = NULL;
    int w = 0;
    int h = 0;
 int bpp = 0;
    int flags = 0;

    SDL_Init( SDL_INIT_VIDEO );
    info = SDL_GetVideoInfo( );

    w = 640;
    h = 480;

    bpp = info->vfmt->BitsPerPixel;

    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

    flags = SDL_OPENGL | SDL_FULLSCREEN;

    SDL_SetVideoMode( w, h, bpp, flags );
    
    ChangeSize( w, h );
 SetupRC();

    while( 1 )
 {
       
        InputHandler( );
        RenderScene( );
    }

    return 0;
}

void RenderScene(void)
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 glMatrixMode(GL_MODELVIEW);
 glLoadIdentity();
 glPushMatrix();

 glBegin(GL_TRIANGLE_STRIP);
 glNormal3f(-0.9f, -0.5f, -0.2f);
 glVertex3f(0.0f, 0.0f, -10.0f);
 glVertex3f(2.0f, 0.0f, -10.0f);
 glVertex3f(1.0f, 2.0f, -10.0f);
 glNormal3f(-0.9f, -0.3f, 0.1f);
 glVertex3f(3.0f, 4.0f, -20.0f);
 glEnd();

 glPopMatrix();
    SDL_GL_SwapBuffers( );
}


void SetupRC()

{
 float ambient0[] = {0.3f, 0.3f, 0.3f, 1.0f};
 float diffuse0[] = {0.7f, 0.7f, 0.7f, 1.0f};
 float specular0[] = {0.8f, 0.8f, 0.8f, 1.0f};
 float specref0[] = {0.8f, 0.8f, 0.8f, 1.0f};

 glEnable(GL_DEPTH_TEST);
 glFrontFace(GL_CCW);
 glEnable(GL_CULL_FACE);
 glEnable(GL_LIGHTING);
 
 glLightfv(GL_LIGHT0,GL_AMBIENT,ambient0);
 glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse0);
 glLightfv(GL_LIGHT0,GL_SPECULAR,specular0);
 glEnable(GL_LIGHT0);

 glEnable(GL_COLOR_MATERIAL);
 glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

 glMaterialfv(GL_FRONT, GL_SPECULAR, specref0);
 glMateriali(GL_FRONT, GL_SHININESS, 100);

 glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
 glColor3f(1.0f, 0.0f, 0.0f);
}


void ChangeSize(int w, int h)

{

 float lightpos0[] = {-50.0f, 50.0f, 100.0f, 1.0f};
 glLightfv(GL_LIGHT0, GL_POSITION, lightpos0);

 float fAspect;

 if(h==0)
  h=1;

 glViewport(0,0,w,h);
 fAspect = (float)w/(float)h;
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity();

 gluPerspective(45.0f, fAspect, 1.0f, 400.0f);
 
 glMatrixMode(GL_MODELVIEW);
 glLoadIdentity();

}

void InputHandler()

{
 SDL_Event event;

 while(SDL_PollEvent(&event))
 {
  switch(event.type)
  {
  case SDL_KEYDOWN:
  case SDL_KEYUP:
   HandleKeyboardEvent(&event);
   break;

  case SDL_MOUSEMOTION:
  case SDL_MOUSEBUTTONDOWN:
  case SDL_MOUSEBUTTONUP:
   HandleMouseEvent(&event);
   break;
  }
 }
}

void HandleKeyboardEvent(SDL_Event *event)
{
 SDL_KeyboardEvent *key=&event->key;

 switch(key->type)
 {
  case SDL_KEYUP:

  switch(key->keysym.sym)
  {
   case SDLK_ESCAPE:
    break;

   default:
    break;
  }


  case SDL_KEYDOWN:

  switch(key->keysym.sym)
  {
   case SDLK_ESCAPE:
    exit(0);
    break;

   default:
    break;
  }

  default:
   break;
 }
}

void HandleMouseEvent(SDL_Event *event)
{
 SDL_MouseMotionEvent *motion=&event->motion;
 SDL_MouseButtonEvent *button=&event->button;

 switch(event->type)
 {
  case SDL_MOUSEMOTION:
   break;
  case SDL_MOUSEBUTTONDOWN:
   break;
  case SDL_MOUSEBUTTONUP:
   break;

  default:
   break;
 }
}

The same code on win32, compiled with vc6, and displayed on a GeForceMX has no flicker. I’m not sure what the problem is at this point. It won’t help the flicker, but it would be good to call SDL_Quit(); before exit(0);----- Original Message -----
From: Alan Ide
To: sdl at libsdl.org
Sent: Tuesday, September 18, 2001 12:10 AM
Subject: Re: [SDL] Flicker Errors while blending OpenGL and SDL

I am using a voodoo 5500 agp, so i am pretty sure that i can handle double buffering. Any other suggestions? My syntax is right, is there a performance call i missed somewhere?
----- Original Message -----
From: Vince
To: sdl at libsdl.org
Sent: Monday, September 17, 2001 6:24 PM
Subject: Re: [SDL] Flicker Errors while blending OpenGL and SDL

What video card are you using?
 
Try:
bool x = glGetBooleanv(GL_DOUBLEBUFFER);
Too see if you support double buffering.

Vince~

  ----- Original Message ----- 
  From: Alan Ide 
  To: sdl at libsdl.org 
  Sent: Monday, September 17, 2001 10:32 PM
  Subject: [SDL] Flicker Errors while blending OpenGL and SDL


  Alright, I got this code working, now could someone please tell me why on earth my screen looks like it kind of flickers, but more like its running at the wrong refresh or something? any takers?

  PS ESC key is used to exit program.

  I linked opengl32.lib, glu32.lib, SDL.lib, and SDLmain.lib 

  #include <windows.h>
  #include <SDL.h>
  #include <gl\gl.h>
  #include <gl\glu.h>

  void SetupRC();
  void ChangeSize(int, int);
  void RenderScene();
  void InputHandler();
  void HandleKeyboardEvent(SDL_Event *event);
  void HandleMouseEvent(SDL_Event *event);

  int main(int argc, char* argv[])
  {
      const SDL_VideoInfo* info = NULL;
      int w = 0;
      int h = 0;
   int bpp = 0;
      int flags = 0;

      SDL_Init( SDL_INIT_VIDEO );
      info = SDL_GetVideoInfo( );

      w = 640;
      h = 480;

      bpp = info->vfmt->BitsPerPixel;

      SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
      SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
      SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
      SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
      SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

      flags = SDL_OPENGL | SDL_FULLSCREEN;

      SDL_SetVideoMode( w, h, bpp, flags );
      
      ChangeSize( w, h );
   SetupRC();

      while( 1 )
   {
         
          InputHandler( );
          RenderScene( );
      }

      return 0;
  }

  void RenderScene(void)
  {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   glPushMatrix();

   glBegin(GL_TRIANGLE_STRIP);
   glNormal3f(-0.9f, -0.5f, -0.2f);
   glVertex3f(0.0f, 0.0f, -10.0f);
   glVertex3f(2.0f, 0.0f, -10.0f);
   glVertex3f(1.0f, 2.0f, -10.0f);
   glNormal3f(-0.9f, -0.3f, 0.1f);
   glVertex3f(3.0f, 4.0f, -20.0f);
   glEnd();

   glPopMatrix();
      SDL_GL_SwapBuffers( );
  }


  void SetupRC()

  {
   float ambient0[] = {0.3f, 0.3f, 0.3f, 1.0f};
   float diffuse0[] = {0.7f, 0.7f, 0.7f, 1.0f};
   float specular0[] = {0.8f, 0.8f, 0.8f, 1.0f};
   float specref0[] = {0.8f, 0.8f, 0.8f, 1.0f};

   glEnable(GL_DEPTH_TEST);
   glFrontFace(GL_CCW);
   glEnable(GL_CULL_FACE);
   glEnable(GL_LIGHTING);
   
   glLightfv(GL_LIGHT0,GL_AMBIENT,ambient0);
   glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse0);
   glLightfv(GL_LIGHT0,GL_SPECULAR,specular0);
   glEnable(GL_LIGHT0);

   glEnable(GL_COLOR_MATERIAL);
   glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);

   glMaterialfv(GL_FRONT, GL_SPECULAR, specref0);
   glMateriali(GL_FRONT, GL_SHININESS, 100);

   glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
   glColor3f(1.0f, 0.0f, 0.0f);
  }


  void ChangeSize(int w, int h)

  {

   float lightpos0[] = {-50.0f, 50.0f, 100.0f, 1.0f};
   glLightfv(GL_LIGHT0, GL_POSITION, lightpos0);

   float fAspect;

   if(h==0)
    h=1;

   glViewport(0,0,w,h);
   fAspect = (float)w/(float)h;
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();

   gluPerspective(45.0f, fAspect, 1.0f, 400.0f);
   
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();

  }

  void InputHandler()

  {
   SDL_Event event;

   while(SDL_PollEvent(&event))
   {
    switch(event.type)
    {
    case SDL_KEYDOWN:
    case SDL_KEYUP:
     HandleKeyboardEvent(&event);
     break;

    case SDL_MOUSEMOTION:
    case SDL_MOUSEBUTTONDOWN:
    case SDL_MOUSEBUTTONUP:
     HandleMouseEvent(&event);
     break;
    }
   }
  }

  void HandleKeyboardEvent(SDL_Event *event)
  {
   SDL_KeyboardEvent *key=&event->key;

   switch(key->type)
   {
    case SDL_KEYUP:

    switch(key->keysym.sym)
    {
     case SDLK_ESCAPE:
      break;

     default:
      break;
    }


    case SDL_KEYDOWN:

    switch(key->keysym.sym)
    {
     case SDLK_ESCAPE:
      exit(0);
      break;

     default:
      break;
    }

    default:
     break;
   }
  }

  void HandleMouseEvent(SDL_Event *event)
  {
   SDL_MouseMotionEvent *motion=&event->motion;
   SDL_MouseButtonEvent *button=&event->button;

   switch(event->type)
   {
    case SDL_MOUSEMOTION:
     break;
    case SDL_MOUSEBUTTONDOWN:
     break;
    case SDL_MOUSEBUTTONUP:
     break;

    default:
     break;
   }
  }

You will have to clarify what you mean.

There are two kinds of “flicker” one of them is the refresh rate, which is a
problem with Windows 2000 (OpenGL/DirectDraw/Direct3D at fullscreen always
defaults to 60hz) the other kind of flicker is what happens when it runs in
non-doublebuffered mode, which will look like the screen is tearing or part
of one frame will be part of the next frame, or large sections will be
"background" (if you aren’t clearning the buffers between flips.)

As far as I can tell, there is nothing wrong in your code. If you are
running Windows 2000 there is no appropriate solution to solve the screen
refresh rate problem. Run it in a window to see if the “flicker” still
happens. If your monitor is already set to a higher refresh rate it
shouldn’t “flicker” in a window.

If you are running windows 95b/98/98se/me every resolution has to be
specificaly set to an appropriate refresh rate. This can be done by manually
setting the refresh rate you want for every resolution/color depth in the
display control panels. (ie, change mode, set refresh, change to next mode,
etc)

Windows 2000 however seems to use one refresh rate for everything, but DDraw
seems to constantly use 60hz, even when the override refresh rate option is
used.> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of Alan
Ide
Sent: September 17, 2001 8:33 PM
To: sdl at libsdl.org
Subject: [SDL] Flicker Errors while blending OpenGL and SDL

Alright, I got this code working, now could someone please tell me why on
earth my screen looks like it kind of flickers, but more like its running at
the wrong refresh or something? any takers?
}

Hiya,

Let me ask you this… Have you changed your drivers at all so that
you’re not using v-sync? If so, there’s your problem.

Tuesday, September 18, 2001, 6:10:57 AM, you wrote:

AI> I am using a voodoo 5500 agp, so i am pretty sure that i can handle double buffering. Any other suggestions? My syntax is right, is there a performance call i missed somewhere?
AI> ----- Original Message -----
AI> From: Vince
AI> To: sdl at libsdl.org
AI> Sent: Monday, September 17, 2001 6:24 PM
AI> Subject: Re: [SDL] Flicker Errors while blending OpenGL and SDL

AI> What video card are you using?

AI> Try:
AI> bool x = glGetBooleanv(GL_DOUBLEBUFFER);
AI> Too see if you support double buffering.

AI> Vince~

AI> ----- Original Message -----
AI> From: Alan Ide
AI> To: sdl at libsdl.org
AI> Sent: Monday, September 17, 2001 10:32 PM
AI> Subject: [SDL] Flicker Errors while blending OpenGL and SDL

AI> Alright, I got this code working, now could someone please tell me why on earth my screen looks like it kind of flickers, but more like its running at the wrong refresh or something? any
AI> takers?

Kind regards,

Neil.

Thank you all for your help, I have, for the time being, solved my flicker
problem. I changed the program resolution from 640 by 480 to 800 by 600 and
the flicker went away. I tried alot of other resolutions also, and they all
worked exept the original setting. Go figure? any one know what that would
happen? thanks all…> ----- Original Message -----

From: kisai_z@yahoo.com (Kisai)
To:
Sent: Tuesday, September 18, 2001 3:46 PM
Subject: RE: [SDL] Flicker Errors while blending OpenGL and SDL

You will have to clarify what you mean.

There are two kinds of “flicker” one of them is the refresh rate, which is
a
problem with Windows 2000 (OpenGL/DirectDraw/Direct3D at fullscreen always
defaults to 60hz) the other kind of flicker is what happens when it runs
in
non-doublebuffered mode, which will look like the screen is tearing or
part
of one frame will be part of the next frame, or large sections will be
"background" (if you aren’t clearning the buffers between flips.)

As far as I can tell, there is nothing wrong in your code. If you are
running Windows 2000 there is no appropriate solution to solve the screen
refresh rate problem. Run it in a window to see if the “flicker” still
happens. If your monitor is already set to a higher refresh rate it
shouldn’t “flicker” in a window.

If you are running windows 95b/98/98se/me every resolution has to be
specificaly set to an appropriate refresh rate. This can be done by
manually
setting the refresh rate you want for every resolution/color depth in the
display control panels. (ie, change mode, set refresh, change to next
mode,
etc)

Windows 2000 however seems to use one refresh rate for everything, but
DDraw
seems to constantly use 60hz, even when the override refresh rate option
is
used.

-----Original Message-----
From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of Alan
Ide
Sent: September 17, 2001 8:33 PM
To: sdl at libsdl.org
Subject: [SDL] Flicker Errors while blending OpenGL and SDL

Alright, I got this code working, now could someone please tell me why on
earth my screen looks like it kind of flickers, but more like its running
at
the wrong refresh or something? any takers?
}


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl