SDL Input in OpenGL window

Started by
5 comments, last by walle 18 years, 3 months ago
Is there anyway to pollevents with SDL while having a window fully setup by windows.h? If not, could I still set a visual studio resource editor with buttons and such. I'm really trying to avoid usng SDL_SetVideoMode ...Thanks
Advertisement
You can give SDL a window handle to use (goggle SDL WINDOW HANDLE environment variable for the exact solution). And you could probably init just the event part of SDL without touching any video stuff of it.

I just have one suggestion/or question.. If you are not using graphics, than why do you want SDL for events? Why not use the windows message pump? Also, there are alternatives out there that offer only Input (libGII, OpenInput, and OIS (my little project)).
Thanks for the tip! I was thinking SDL had the best Input in the charts of power and ease of use. I'll look into the other libraries.

UPDATE: I did a little bit of searching and.... I'd perfer SDL Input! OpenInput sounds interesting but it's offline. How would I grab SDL Input using the Window's Message Pump?
why not use SDL to open the window...you don't have to bother about the messy windows init code...and your app will be cross platform(probably) without you doing anything activly for it to happen.
SDL init ~10 rows windows init ~100 rows. Or? Newer really inited windows...but I have looked at the code...messy =)
I think you missunderstood.. I was mentioning to use either Windows message loop or SDL not both.

My understanding is that you already have your own GL and window setup code working, and do not need SDL for anything other than window (or input) events - in which case the alternatives I mention I believe to be superior than SDL.
Quote:Original post by walle
why not use SDL to open the window...you don't have to bother about the messy windows init code...and your app will be cross platform(probably) without you doing anything activly for it to happen.
SDL init ~10 rows windows init ~100 rows. Or? Newer really inited windows...but I have looked at the code...messy =)

I've thought about that but I"m not sure how far I can go with it. I'd like to be able to setup multiple windows, buttons, and menu functions. I don't think it'll work.

Quote:Original post by pjcast
I think you missunderstood.. I was mentioning to use either Windows message loop or SDL not both.


That seems to be the problem. To use the SDL input I have to poll events. SDL polling will not work if I use the Windows message loop. It seems to need its own window to do that which brings me to the above post.
Well if you need multiple windows SDL isn't for you...because it doesn't suport it...

This topic is closed to new replies.

Advertisement