🔒 Locked
GLUT vs WIN API
Advertisement
Original Post
I was just wondering what is faster: Using GLUT for initializing, Getting Key input (glutKeyboardFunc() ), mouse input etc...
Or is is faster to use the Win API directly i.e. handling the keyboard input in the WndProc function?
Not that it matters for my games as I''m still quite new to Game Programming. But I was just wondering if there was a significant difference.
I would have to say no, but it is MUCH faster to develop using GLUT. If you need windows, you can always make your program in GLUT to see if it works, then replace the GLUT components with Windows and add in whatever you need with Windows later. That''s how i develop my softs anyway . . .
Good luck on your projects.
Good luck on your projects.
Short answer, use GLUT.
Why:
1) It''s simpler than Win32 API.
2) Linux (and OS/2, MacOS, and BeOS, etc.) users (like me) can play your games too
What I would do is to use SDL.
Why
1) Same reasons as above
2) Better input handling
3) SDL has sounds, and with the add-on SDL_mixer, you get a nice sound API that is simple and quick.
-Richardo
Why:
1) It''s simpler than Win32 API.
2) Linux (and OS/2, MacOS, and BeOS, etc.) users (like me) can play your games too
What I would do is to use SDL.
Why
1) Same reasons as above
2) Better input handling
3) SDL has sounds, and with the add-on SDL_mixer, you get a nice sound API that is simple and quick.
-Richardo
---------------------------
for(goodness_sake())
{
do
{
something();
} while(you_can())
}
Now that sounds great, I mean SDL. I''ve already seen a lot of poeple mentioning it, but never bothered to check it out. However, after reading through a few tutorials about SDL, I think I''m gonna try to figure that out. Indeed, for the moment I don''t really want to learn DirectSound and stuff (I''m busy enough figuring out OpenGL) to get some sound working in my game. But with SDL this should be a piece of cake. Seems fairly simple.
If I could do no more than add to pile;
Win32 code is both horrible and ugly.
There are two groups of people I develop games with; those who''ve taken my advice and who use GLUT, SDL and SDL_mixer, and those who try to do it all in Win32 and DirectX.
As it stands now, those of us going the GLUT + SDL route have been a *lot* more productive.
Think about it: if you design games with OpenGL, and you use GLUT and SDL, your stuff is pretty much instantly portable to numerous platforms. If you spend (or waste, I would say) your time learning heavily OS-specific code, both your code AND your yourself are less flexible because of it.
Open source libs not fast enough, you argue? Just take out some polygons and save yourself the big Microsoft-induced headache...
Win32 code is both horrible and ugly.
There are two groups of people I develop games with; those who''ve taken my advice and who use GLUT, SDL and SDL_mixer, and those who try to do it all in Win32 and DirectX.
As it stands now, those of us going the GLUT + SDL route have been a *lot* more productive.
Think about it: if you design games with OpenGL, and you use GLUT and SDL, your stuff is pretty much instantly portable to numerous platforms. If you spend (or waste, I would say) your time learning heavily OS-specific code, both your code AND your yourself are less flexible because of it.
Open source libs not fast enough, you argue? Just take out some polygons and save yourself the big Microsoft-induced headache...
quote:
Original post by smarson
Open source libs not fast enough, you argue? Just take out some polygons and save yourself the big Microsoft-induced headache...
I never argued that Open Source libs are not fast enough. You may have misunderstood me. I just asked out of curiosity. And as I said in my last post: I gonna try figuring out SDL. In fact, I already worked through some tutorials.
I also strongly suggest SDL.
It is very easy, has good docs, it is portable, etc.
I spent only like 3 hours of coding to make my game run on Linux. (and it was no SDL related stuff, it was more like fixing some \ into / in path names, and some floar random number generator.
Oh, yeah, and detecting if I havea stencil buffer, in Linux.
Height Map Editor | Eternal Lands | Fast User Directory
It is very easy, has good docs, it is portable, etc.
I spent only like 3 hours of coding to make my game run on Linux. (and it was no SDL related stuff, it was more like fixing some \ into / in path names, and some floar random number generator.
Oh, yeah, and detecting if I havea stencil buffer, in Linux.
Height Map Editor | Eternal Lands | Fast User Directory
RizMan: I didn''t mean *you* specifically. I was addressing the "you''s" out there who argue that GLUT and the like are less efficient than dealing directly with the OS - which they ARE, but the difference really is minimal.
Also, I should mention that using OpenGL through GLUT or SDL isn''t 100% compatible with some graphics systems, most notably the real weird stuff that people stuff in their machines.
I''m having people beta test my game, which uses GLUT and SDL_mixer, and I get occasional reports of "hey, this doesn''t work", and the cause is almost certainly GLUT''s OpenGL interface.
So; when I finish an actual *release* version of my game, I''m probably going to have to do my own Win32 OpenGL base code. But, that''s right before I start charging $19.99 for it!
Also, I should mention that using OpenGL through GLUT or SDL isn''t 100% compatible with some graphics systems, most notably the real weird stuff that people stuff in their machines.
I''m having people beta test my game, which uses GLUT and SDL_mixer, and I get occasional reports of "hey, this doesn''t work", and the cause is almost certainly GLUT''s OpenGL interface.
So; when I finish an actual *release* version of my game, I''m probably going to have to do my own Win32 OpenGL base code. But, that''s right before I start charging $19.99 for it!
quote:
Original post by smarson
RizMan: I didn''t mean *you* specifically. I was addressing the "you''s" out there who argue that GLUT and the like are less efficient than dealing directly with the OS - which they ARE, but the difference really is minimal.
Also, I should mention that using OpenGL through GLUT or SDL isn''t 100% compatible with some graphics systems, most notably the real weird stuff that people stuff in their machines.
I''m having people beta test my game, which uses GLUT and SDL_mixer, and I get occasional reports of "hey, this doesn''t work", and the cause is almost certainly GLUT''s OpenGL interface.
So; when I finish an actual *release* version of my game, I''m probably going to have to do my own Win32 OpenGL base code. But, that''s right before I start charging $19.99 for it!
My advice is to use SDL.
So far, a lot of people tested my game, and, besides for those who didn''t read the license, or those without hardware opengl support, no one had problems with it. And ti was tested both under Windows and Linux.
Height Map Editor | Eternal Lands | Fast User Directory
Maybe it''s better for a bloody beginner....
But if you want to make bigger things than the 9823th Pong you''ll
will get stuck with sdl/glut very fast...
I don''t use DirectX, it stinks!
I use OpenGL/software rendering, OpenAL for sound, Sockets for networking, and plain low-level-os-code for the other stuff...
When I compile my stuff for Linux I only switch to another
low-level-module file
But if you want to make bigger things than the 9823th Pong you''ll
will get stuck with sdl/glut very fast...
I don''t use DirectX, it stinks!
I use OpenGL/software rendering, OpenAL for sound, Sockets for networking, and plain low-level-os-code for the other stuff...
When I compile my stuff for Linux I only switch to another
low-level-module file
quote:
Original post by smarson
If I could do no more than add to pile;
Win32 code is both horrible and ugly.
Ugly is your m..
There are thing that with win32 u can do taht glut can''t ..
Learning the api for the specific plataform is what makes a good developer for that plataform , not just "learning" a wrapper ..
quote:
Original post by RizMan
I was just wondering what is faster: Using GLUT for initializing, Getting Key input (glutKeyboardFunc() ), mouse input etc...
Or is is faster to use the Win API directly i.e. handling the keyboard input in the WndProc function?
Not that it matters for my games as I''m still quite new to Game Programming. But I was just wondering if there was a significant difference.
i think there MIGHT be some diference ... i totally think that win32 will be faster,but again if you need to check a key do GetKeyState (VIRTUAL_KEY) & 0x80 , it''s faster than checking in the WndProc
Of course it is certainly better to use the low-level API of the OS as far as performance and control goes. But I''d like my games to be portable to other OSes. And I''m still far from doing any fance 3D Engine. I''m still in the state of doing an ugly looking simple game like Sokuban (which I was planning to do in some kind of 3d Version )
The amount of work that you should be doing in your actual rendering code will completely dwarf any slight differences in speed between Win32, GLUT or SDL windowing wrappers. Forget about it and find the one you''re most comfortable with.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
quote:
Original post by siaspete
The amount of work that you should be doing in your actual rendering code will completely dwarf any slight differences in speed between Win32, GLUT or SDL windowing wrappers. Forget about it and find the one you''re most comfortable with.
That''s what I was thinking too.
I would check out OpenAL for sound. sorry I don't have a link, but its done by creative and works really well. I like it alot. As for glut, I think its great for learning and you should be able to make a pretty good game with it. If your project is more ambitious though I would do the OS programming for each OS you want the game to work on. If you ever want a project to work on windows only(for some crazy reason) just use directX. But thats only my opinion. I am still waiting for a good input API that is portable. If anyone knows of any I would apreciate it if you could give me a link. thx.
[edited by - dead_roses on February 27, 2003 5:52:00 PM]
[edited by - dead_roses on February 27, 2003 5:52:00 PM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement