SDL. would YOU recommend it ?

Started by
50 comments, last by Prune 14 years, 2 months ago
I really like FreeGLUT. Its under active development and really simple, its designed to work with OpenGL from the start, AND it works with OpenGL 3.0. I like it a lot.
Advertisement
Quote:Original post by Steve132
I really like FreeGLUT. Its under active development and really simple, its designed to work with OpenGL from the start, AND it works with OpenGL 3.0. I like it a lot.
Another worthy choice is glfw-lite, unfortunately only available from the subversion repository. Basically, they stripped all the cruft (threading, image loading, etc.) out of glfw, and updated it considerably.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:Original post by FlyingSolo
Hi folks,
after quite a few problems with NeHe's basecode when resizing my opengl window on various different systems(esp Win7 grrrr) I had SDL recommended to me.


I've never touched SDL. However, I have been using OpenGL for many years. I would really recommend that you try and get the base code working, if for no other reason than understanding how to implement an OpenGL context fully in Windows. I'm using OpenGL under Windows 7 and have had no trouble with it at all.

SDL may be the best thing for your project; I simply do not know. However, using it to avoid learning how / having to solve a problem will only cause you headaches in the future.

Also, the NeHe tutorials are not the best way to get started. They have caused me a great deal of frustration. Many of them are poorly written and the Windows code is horrible. When I was starting to learn Windows programming a couple of years ago, I made the mistake of trying to use the NeHe examples. I ended up getting more information and understanding out of a 10 year old Windows 95 game programming book.

Exactly what problems are you having?

No, I am not a professional programmer. I'm just a hobbyist having fun...

I like SFML because it is a bit more modular than SDL. In terms of window management and input events, it is pretty much identical to SDL, but you have the ability to link just the system and window libraries and just leave out all the crap you don't need, like the sprite system, sound, and networking to help keep your namespaces uncluttered.
I also would like to reccomend qt, I switched from SDL to it, and have had great success... Screenshot
Douglas Eugene Reisinger II
Projects/Profile Site
Quote:Original post by maspeir
I've never touched SDL. However, I have been using OpenGL for many years. I would really recommend that you try and get the base code working, if for no other reason than understanding how to implement an OpenGL context fully in Windows. I'm using OpenGL under Windows 7 and have had no trouble with it at all.


Oh I've spent many happy hours reading thru MSDN looking for the answers but the big problem with MSDN is that a lot of it is out of date and it contradicts itself repeatedly. Not very confidence inspiring.

Quote:SDL may be the best thing for your project; I simply do not know. However, using it to avoid learning how / having to solve a problem will only cause you headaches in the future.


I pretty much solved all the windows problems by removing the NeHe basecode and writing my own but since my app needs to be cross platform, SDL makes that little task a lot easier. I've been programming since 1977 so I'm well aware that if your foundation code is poor - you're gonna get your ass bit sooner or later. (usually sooner!)

Quote:Also, the NeHe tutorials are not the best way to get started. They have caused me a great deal of frustration. Many of them are poorly written and the Windows code is horrible.


I can't agree entirely with you here, the opengl aspects of Jeff's tutorials are pretty good I think and I'm very grateful to Jeff for making them available, but yes - the windows code is, well, maybe not so good. Jeff makes no claims to being an expert though.

Quote:Exactly what problems are you having?


The major problem was having the window go to black following a resize under Win7(64) or some corruption if going full-screen under windows XP. I'd finally got this sorted out by rewriting the window handling portions of my code when I decided that maybe something like SDL was a better way forward. I generally hate to use 3rd party lib's. The recommendations from the good folks here sealed it and so far, SDL has delivered the goods with remarkable ease.

Quote:Original post by FlyingSolo
the opengl aspects of Jeff's tutorials are pretty good I think
They were a useful resource at some point in time, but they bear no relation to modern OpenGL programming. There are a few newer tutorials on the NeHe site aimed at rectifying this, but as I understand it, progress is slow.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Quote:Original post by FlyingSolo
The major problem was having the window go to black following a resize under Win7(64) or some corruption if going full-screen under windows XP. I'd finally got this sorted out by rewriting the window handling portions of my code when I decided that maybe something like SDL was a better way forward. I generally hate to use 3rd party lib's. The recommendations from the good folks here sealed it and so far, SDL has delivered the goods with remarkable ease.


Something you should probably be aware of, then, is that SDL has a pretty well-known problem with fullscreening/resizing on Windows. The OpenGL context is lost when a fullscreen or resize happens. This means you need to reload all your textures and reset the OpenGL context completely.

Not a big deal (and it doesn't happen on Linux), but probably something to be aware of.
I like SDL because it is a lightwight way to have the window-management/timers etc done without using GLUT. And it is X-Platform.
regards
Quote:Original post by FlyingSolo
Oh I've spent many happy hours reading thru MSDN looking for the answers but the big problem with MSDN is that a lot of it is out of date and it contradicts itself repeatedly. Not very confidence inspiring.


Yes, MSDN is very obtuse.

Quote:Original post by FlyingSolo
I pretty much solved all the windows problems by removing the NeHe basecode and writing my own but since my app needs to be cross platform, SDL makes that little task a lot easier. I've been programming since 1977 so I'm well aware that if your foundation code is poor - you're gonna get your ass bit sooner or later. (usually sooner!)


Ah. I didn't catch the need for cross platform. It's never easy to tell how long someone has been at this.

Quote:Original post by FlyingSolo
I can't agree entirely with you here, the opengl aspects of Jeff's tutorials are pretty good I think and I'm very grateful to Jeff for making them available, but yes - the windows code is, well, maybe not so good. Jeff makes no claims to being an expert though.


My statement was overly broad, but I stand behind it. The tutorials are, for the most part, still based on GL 1.1 and immediate mode. As such, they teach newbies a very antiquated method which is no longer relevant. To make it worse, it is now tied to this site, which lends credence to its usefulness. The tutorials, as currently written, need to be scrapped and rewritten. It does more harm than good to keep them up as is.

The Windows code is not too bad, but if there ever was a case of over-commenting code, this is it. I've simply stopped using it. Not because it doesn't work, but because it takes me so freaking long to reformat it into readable code. I know everyone has different coding styles and debating them turns into flame fests, but this code is simply atrocious.

Quote:Original post by FlyingSolo
The major problem was having the window go to black following a resize under Win7(64) or some corruption if going full-screen under windows XP.


Now that you mentioned it, I did have a brief problem like you describe. I simply cannot remember what I did to correct it.

No, I am not a professional programmer. I'm just a hobbyist having fun...

This topic is closed to new replies.

Advertisement