SDL + OpenGL + Win98

Hi all,

I’ve got an SDL+OpenGL application that runs fine on Win XP (the dev
environment). However, when I run it on a Win 98 box, I get a strange issue
with the mouse.

The basic startup is like this:

SDL_Init(SDL_INIT_EVERYTHING)
input startup (keyboard, joystick)
sound startup (Mix_OpenAudio, etc)
SDL_SetVideoMode(w,h,color_depth, SDL_OPENGL | SDL_FULLSCREEN)
bunch of gl commands (glClearColor, glClearDepth, glDepthFunc, glHint,
glBlendFunc, glCullFace, glFrontFace, glClear)
SDL_ShowCursor(0)

When the app starts up, for a brief moment, the black-with-white outline mouse
displays (presumably during the SDL_SetVideoMode, the gl commands, then the
SDL_ShowCursor(0)).

But then, after a few minutes, the Win 98 standard mouse cursor (white, most
times appearing initially with an hourglass next to it, then back to a normal
white cursor) appears in the middle of the screen. Presumably some system event
happens in the background causing the cursor to appear.

I did a fresh install of Win98SE (no windows updates, straight out of the box)
and the issue still occurs. Tried using the cursor commands to move it out of
the way but the SDL commands appear to have no effect on it after it appears.
However, moving the mouse physically causes it to disappear (only to have it
show up again a few minutes later).

Anyone else had an experience like this with SDL / OpenGL? As I mentioned
before, the app works perfectly in Win XP. I’m running SDL-1.2.11.
Unfortunately, the hardware the app is running on doesn’t support Win XP,
otherwise that would be the obvious solution.

Thanks for any suggestions!

Mark Jenison <jenison enteract.com> writes:

Hi all,

I’ve got an SDL+OpenGL application that runs fine on Win XP (the dev
environment). However, when I run it on a Win 98 box, I get a strange issue
with the mouse.

Sorry, I didn’t make this clear: The application does not use the mouse at all
as an input (connected just so I don’t get those annoying “Windows cannot find a
mouse” errors. The app only uses the keyboard and joystick as inputs.–
Mark Jenison

How do you handle events? Remember to regularly (ideally once a frame)
clear the SDL event queue. I believe what might be happening is that
the OS is trying to send events to your program but your program can
no longer respond to them as you do not handle them fast enough. That
is just a guess though.On 29/09/2007, Mark Jenison wrote:

Mark Jenison <jenison enteract.com> writes:

Hi all,

I’ve got an SDL+OpenGL application that runs fine on Win XP (the dev
environment). However, when I run it on a Win 98 box, I get a strange issue
with the mouse.

Sorry, I didn’t make this clear: The application does not use the mouse at all
as an input (connected just so I don’t get those annoying “Windows cannot find a
mouse” errors. The app only uses the keyboard and joystick as inputs.


Mark Jenison


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Brian <brian.ripoff gmail.com> writes:

How do you handle events? Remember to regularly (ideally once a frame)
clear the SDL event queue. I believe what might be happening is that
the OS is trying to send events to your program but your program can
no longer respond to them as you do not handle them fast enough. That
is just a guess though.

for the input startup, I do this:

SDL_EnableUnicode(1);
if (SDL_NumJoysticks())
{
SDL_JoystickEventState(SDL_IGNORE);
joystick = SDL_JoystickOpen(0);
}

The program runs in a tight loop
while (!finished)
{
update sounds
if (ready)
drawScreen()

while (framecount > 0)
{
advance_frame();
handle_events();
handle_input_state();
updateScreen();
–frame_count;
}
}

In the handle_events:
while (SDL_PollEvent(&event)
{
// check event types
switch(event.type)
{
// check keyboard events, videoresize
}
}

So I think everything is being handled frequently enough…any tips on how to
verify that this may be the issue?

One I should mention is the WinXP environment doesn’t have a joystick
connected…so maybe the Joystick routines are causing an issue?–
Mark Jenison