Am I the only one having issues with WindowsXP & OpenGL

& SDL 1.2.4???
Content-Type: text/plain; charset=“iso-8859-1”

I’m also using SDL with Win XP pro, though I mostly write 2d apps. I
have ran a few of my older OGL apps (mainly trying to figure out why
XP was slower in OGL than previous, lesson learned “Update your video
drivers”). The only problems I noticed with the quick launch bar was
that occasionally it would dissappear after I exited a program. It
would return if I hovered the mouse over it. I blame it on MS bugs in
xp’s themable explorer shell, and the closest I can come to verifying
it is that in TweakUI there is are “Rebuild” options for things that
just get thrashed while running XP (icons, fonts, etc). Maybe it’ll
be cleared up when XP SE is released in a few months, maybe not,
either way it’s most likely XP’s fault and switching to Direct X would
be side stepping around bugs that MS has introduced. Stick with OGL,
be portable, be happy :slight_smile:

Wesley Poole
AKA Phoenix Kokido
Tired of hiding behind a on-line only identity…
members.xoom.com/kokido
@Wes_Poole

MARS_999 wrote:
Hopefully someone else is having the same problem as me? If I run
fullscreen with SDL and OpenGL my quicklaunch, system tray icons mess
up. The tooltip box don’t match up with the icons program name? If I
run in a window mode everything is fine. I have a AthlonXP 1800+,
Radeon 8500 card, 768MB, MSI K7T Pro 2RU MB. I am running Windows XP
Prof. I never had these problems with my Win2K system. I hope this
issue can be fixed soon, I don’t want to stop using SDL due to me
switching back to a Mac in the next few months. I want to be able to
code on the PC till then and want my code portable. I do not want to
use Direct X. I am wondering if OpenGL is the problem? Is it Windows
XP? I just need some answers before I go nuts!!! Here is my code for
someone to look at and see if their is something wrong. Thanks.

//includes header
#include “includes.h”

//globals
int game_state = 0;
Sprite *jet = new Sprite();

ofstream fout(“error.txt”);

//consts
const int width = 1024;
const int height = 768;
const int bits = 32;

//() prototypes
void Render(void);
void Update(void);
bool LoadTextures(void);
bool InitGame(void);
bool InitSDL(int width, int height, int bits);
bool InitOpenGL(int width, int height);
void Quit(void);
void FreeMemory(void);
void GetEvents(void);

//main(void)
int main(int argc, char *argv[])
{
if(InitSDL(width, height, bits) != true)
Quit();

if(InitOpenGL(width, height) != true)
Quit();

if(LoadTextures() != true)
Quit();

if(InitGame() != true)
Quit();

while(game_state == 0)
{
Render();
GetEvents();
}

Quit();

return 0;
}

void Render(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

jet->Draw();

SDL_GL_SwapBuffers();
}

void Update(void)
{
}

bool LoadTextures(void)
{
return true;
}

bool InitGame(void)
{
return true;
}

bool InitSDL(int width, int height, int bits)
{
if(SDL_Init(SDL_INIT_EVERYTHING) != 0)
{
fout << “Error on Initialization of SDL\n”;
Quit();
}

if(SDL_SetVideoMode(width, height, bits, SDL_FULLSCREEN | SDL_OPENGL) ==
NULL)Date: Wed, 01 May 2002 16:55:56 +0000
{
fout << “Error on Initialization of OpenGL\n”;
Quit();
}

return true;
}

bool InitOpenGL(int width, int height)
{
glViewport(0, 0, width, height);

glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glShadeModel(GL_SMOOTH);
glClearDepth(1.0f);

glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_ALPHA_TEST);
glFrontFace(GL_CCW);

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_LEQUAL);

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);

glMatrixMode(GL_PROJECTION);

glLoadIdentity();

glOrtho(0.0, double(width), 0.0, double(height), -100.0, 100.0);

glMatrixMode(GL_MODELVIEW);

return true;
}

void Quit(void)
{
FreeMemory();
SDL_Quit();
fout.close();
}

void FreeMemory(void)
{
delete jet;
}

void GetEvents(void)
{
SDL_Event event;

while(SDL_PollEvent(&event))
{
    switch(event.type)
    {
        case SDL_KEYDOWN:
            switch(event.key.keysym.sym)
            {
                case SDLK_ESCAPE:
                    game_state = 1;
                    break;
 
 default:
                    break;
            }
            break;

case SDL_MOUSEBUTTONDOWN:
break;

case SDL_MOUSEMOTION:
default:
break;
}
}
}

That makes a lot of sense, with something I see on XP. When I am playing a
game (not just SDL, Civ3 sometimes, Diablo II, Master of Orion II, etc), I
see issues like this, but it isn’t so bad since I moved my quicklaunch to
pop out of the side, instead of with the start bar. Also, since I use large
icons, the problem isn’t so prevalent.

-Jim Stapleton> ----- Original Message -----

From: kokido@postmark.net (Wes Poole)
To:
Sent: Wednesday, May 01, 2002 12:55 PM
Subject: Re: [SDL] Am I the only one having issues with WindowsXP & OpenGL

& SDL 1.2.4???
Date: Wed, 01 May 2002 16:55:56 +0000
Content-Type: text/plain; charset=“iso-8859-1”

I’m also using SDL with Win XP pro, though I mostly write 2d apps. I
have ran a few of my older OGL apps (mainly trying to figure out why
XP was slower in OGL than previous, lesson learned “Update your video
drivers”). The only problems I noticed with the quick launch bar was
that occasionally it would dissappear after I exited a program. It
would return if I hovered the mouse over it. I blame it on MS bugs in
xp’s themable explorer shell, and the closest I can come to verifying
it is that in TweakUI there is are “Rebuild” options for things that
just get thrashed while running XP (icons, fonts, etc). Maybe it’ll
be cleared up when XP SE is released in a few months, maybe not,
either way it’s most likely XP’s fault and switching to Direct X would
be side stepping around bugs that MS has introduced. Stick with OGL,
be portable, be happy :slight_smile:

Wesley Poole
AKA Phoenix Kokido
Tired of hiding behind a on-line only identity…
members.xoom.com/kokido
kokido at postmark.net

MARS_999 wrote:
Hopefully someone else is having the same problem as me? If I run
fullscreen with SDL and OpenGL my quicklaunch, system tray icons mess
up. The tooltip box don’t match up with the icons program name? If I
run in a window mode everything is fine. I have a AthlonXP 1800+,
Radeon 8500 card, 768MB, MSI K7T Pro 2RU MB. I am running Windows XP
Prof. I never had these problems with my Win2K system. I hope this
issue can be fixed soon, I don’t want to stop using SDL due to me
switching back to a Mac in the next few months. I want to be able to
code on the PC till then and want my code portable. I do not want to
use Direct X. I am wondering if OpenGL is the problem? Is it Windows
XP? I just need some answers before I go nuts!!! Here is my code for
someone to look at and see if their is something wrong. Thanks.

//includes header
#include “includes.h”

//globals
int game_state = 0;
Sprite *jet = new Sprite();

ofstream fout(“error.txt”);

//consts
const int width = 1024;
const int height = 768;
const int bits = 32;

//() prototypes
void Render(void);
void Update(void);
bool LoadTextures(void);
bool InitGame(void);
bool InitSDL(int width, int height, int bits);
bool InitOpenGL(int width, int height);
void Quit(void);
void FreeMemory(void);
void GetEvents(void);

//main(void)
int main(int argc, char *argv[])
{
if(InitSDL(width, height, bits) != true)
Quit();

if(InitOpenGL(width, height) != true)
Quit();

if(LoadTextures() != true)
Quit();

if(InitGame() != true)
Quit();

while(game_state == 0)
{
Render();
GetEvents();
}

Quit();

return 0;
}

void Render(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

jet->Draw();

SDL_GL_SwapBuffers();
}

void Update(void)
{
}

bool LoadTextures(void)
{
return true;
}

bool InitGame(void)
{
return true;
}

bool InitSDL(int width, int height, int bits)
{
if(SDL_Init(SDL_INIT_EVERYTHING) != 0)
{
fout << “Error on Initialization of SDL\n”;
Quit();
}

if(SDL_SetVideoMode(width, height, bits, SDL_FULLSCREEN | SDL_OPENGL)
==
NULL)

{
fout << “Error on Initialization of OpenGL\n”;
Quit();
}

return true;
}

bool InitOpenGL(int width, int height)
{
glViewport(0, 0, width, height);

glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glShadeModel(GL_SMOOTH);
glClearDepth(1.0f);

glEnable(GL_CULL_FACE);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_ALPHA_TEST);
glFrontFace(GL_CCW);

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_LEQUAL);

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);

glMatrixMode(GL_PROJECTION);

glLoadIdentity();

glOrtho(0.0, double(width), 0.0, double(height), -100.0, 100.0);

glMatrixMode(GL_MODELVIEW);

return true;
}

void Quit(void)
{
FreeMemory();
SDL_Quit();
fout.close();
}

void FreeMemory(void)
{
delete jet;
}

void GetEvents(void)
{
SDL_Event event;

while(SDL_PollEvent(&event))
{
    switch(event.type)
    {
        case SDL_KEYDOWN:
            switch(event.key.keysym.sym)
            {
                case SDLK_ESCAPE:
                    game_state = 1;
                    break;

 default:
                    break;
            }
            break;

case SDL_MOUSEBUTTONDOWN:
break;

case SDL_MOUSEMOTION:
default:
break;
}
}
}


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

Well guess what, I can stop looking for an answer. I bought me a new Geforce 4Ti 4600 card and all my headaches went away. God I didnt’ want my ATI 8500 to be the problem but it was. Not sure if it was drivers or a bad card. I hope its just drivers, but I will post a update if I find out its drivers. My friend has a Radeon 8500 card also. If my code works on his system then it my card. If my code screws up his system than its drivers. He is running the same drivers as me. Later