SDL vs. MFC ogl performance

I’m using SDL in windoze for my window initialization and device input but I see alot of the openGL programmers using MFC. I know there can be issues with color depth in SDL but I am curious if anyone can comment on performance differences between the SDL and MFC. Is it possible that if I continue to use SDL I will eventually end up switching to MFC/DirectInput due to some, currently unforseen, performance issues with SDL???

Well, MFC is a fairly light wrapper around the Win32 API (for the most part). Since SDL adds more layers to allow for cross-platform portability, MFC may well be a bit faster.

At the same time, MFC is written by Microsoft, so it may be rather inefficiently implemented. If you have VC++, you have the source code for MFC, so if you have serious efficiency concerns, feel free to look at MFC’s internals.

I doubt that there are really any differences in performance, and besides SDL is more portable than MFC. Most of your performance losses/gains will be in the OpenGL parts of things, and that should not be any different between different wrappers.

Ok, so while I’m at it I can just as well go ahead and recommend GLFW instead, http://hem.passagen.se/opengl/glfw - it’s more portable than SDL (ok, it “only” supports Windows and Unix/X11, but at least things work exactly the same way regardless of environment, unlike SDL), and I think you’ll aprecieate the API.

First of all, I think SDL code looks much cleaner in terms of windows initialization and input handling. Second, I do like the portability of SDL - I use it on my Linux/GeForce2 partition. It just seems like I see alot of “hardcore” coders in the advanced ogl forum using MFC.

Thanks for the cin>>

I would take a guess that a lot of hard core programmers did not deliberately choose MFC for OpenGL programming. Either they were used to MFC and just continued using it, they already had access to MS VC++ (office, home, etc) and switching to something new did not look appealing, they had to use MFC because that’s the standard among their co-workers/peers, or alternatives were not available or unknown to them at the time. Remember Microsoft has strong brand influence and market share in the programming industry, so it’s very likely that a lot of persons will use their IDE and toolkit.

With that said, MFC has a lot of controls and stuff for windows which makes programming faster and easier. Also the lookup lists and function hints make it one of the best (if not the best) IDEs. People may have problems with it, but I have not heard anyone complain about those features (except that it makes programmers lazy ).

If you’re interested there are a lot of other threads that deal with comparisons. I’ve include one that I remember (http://www.opengl.org/discussion_boards/ubb/Forum2/HTML/007261.html) but you can also search for more. There’s also a new forum for discussing toolkits, etc (http://www.opengl.org/discussion_boards/cgi_directory/forumdisplay.cgi?action=topics&forum=OpenGL+Toolkits+(e.g.+GLUT,+CPW,+GLOW)&number=10&DaysPrune=20&LastLogin=). Check it out and maybe start another thread there.

[This message has been edited by Furrage (edited 02-08-2002).]

Yeh, I think VC++ is a really nice IDE too, better than Kdevelop, if you’re into linux. And in fact, like you said, my other programming job (finite elements) requires that I use VC++ and MFC.

Thanks for the links!

Jeff