Skip to main content
GameDev.net gamedev.net
🔒 Locked

New NeHe Lessons released!!

Started by Caste Jun 13, 2008 at 7:52 AM 35 replies 16.4k views
Original Post
Caste
Caste
Hey folks, after having talked about releasing new lessons for a pretty long time now, we're glad to present you the first 3 new NeHe lessons! They're starting from the beginning again, but this time using way better code style, making use of SDL to have a platform independent basecode and introducing only these features of OpenGL wich will be available in GL 3.0 (will be out in august probably). So if you follow these tutorials you're up to date in means of writing OpenGL applications! These lessons are no longer based on the old NeHe site, but on a wiki. This wiki will more and more be filled with the contents of the original site as it's much easier for us to maintain. You can find the lessons here or by clicking "NewLessons" in the menu on the NeHe site. So if there's anything you want to say about the new lessons: say it here.. [smile] Cheers Carsten (aka Caste) @ NeHe-Team
Toji
Toji
Cool! I've been wondering when these would come out. It's high time that NeHe be brought up to date. :)

Site Observations: (these are mostly nit-picky things)

* Under Firefox 3 the NeHe logo ends up partially obscured by the site text itself. I have a suspicion that this is because of Ad block, since when I view the site in IE7 (with ads) it shows up fine. Don't depend on your ads to push the text into the right place.

* All of the code blocks have 1 line of empty space at their top, but none at the bottom. Pick one or the other, but having them mixed looks funny. (Sorry, I used to be a web designer. Can you tell?)

Code Observations:

* The directory structure in the downloaded zips seems a tad overwhelming and unnecessary to me, made more so by the fact that the lesson files cannot be extracted to the same place (Main.cpp would conflict, etc). New programmers will likely be interested in only one thing up front: the project file. It should be as easy to access as possible.

* All of the folder names in the visual studio project are in German :) Nothing against Germany, but it seems odd for a tutorial written in English.

* The association between the "Lesson" and "Window" classes is very loose, but they are extremely interdependent on each other, specifically when it comes to the SDL components. It seems odd, for example, that while the Window class creates the SDL environment, the Lesson class is what handles all of the messages for it. This takes advantage of the fact that SDL (like OpenGL) is a C library and globally accessible, but it breaks strict object-orientation and would not work (well) for other scenarios. i.e: If one were to try to port these tutorials to DirectX the class layout would become unruly fast. Quite frankly, I'm not sure why they have to be two separate classes at all, since the Lesson doesn't do much on its own. If they are going to be separate I feel like inheriting Lesson from Window may make a bit more sense. That way everything is working in an explicitly shared space instead of an implicitly shared one.

* This may just be me, but I pointed the code at my pre-existing SDL installation (1.2, I believe) and found that I had to change all the SDL includes from to simply in order to compile. My release simply wasn't organized that way.

* Under Windows the tutorial launches a console before the window. That can be nice for debugging, but I think you'll turn a lot of people off with it. At least have a tutorial that shows how to launch SDL without it. (And if you're not sure how, give me a shout. It's just some configuration fluff.)

* I applaud your decision to move away from immediate mode rendering, and I like the decision to use vector::push_back for geometry setup, since that will give a bit of familiarity to those who already know the immediate mode calls. I somewhat question the decision to use Vertex Arrays instead of VBOs, however. While there's no question that Vertex Arrays are a big step up from immediate mode, I think that they're becoming obsolete fast. OpenGL 3 isn't going to support them (IIRC), and DirectX has always discouraged it's equivalent functionality. I'd just hate to see the tutorial life artificially limited because of this choice. (Although I can agree that it is more clear for new developers. *sigh*)

I'll play around with them some more and see if I find anything new, these are just "first-glance" impressions.

I hope I don't come off as harsh, since I think it's great that there's a movement to inform people about better OpenGL usage. I want these tutorials to succeed, so if any of my comments seem overtly critical it's only because I would hate to see a little problem on my end turn into a deal-breaking frustration for someone new to the field.

Best of luck with these tutorials, and may you see just as much success as Jeff did!

[Edited by - Toji on June 13, 2008 3:52:38 PM]
// The user formerly known as Tojiro67445, formerly known as Toji [smile]
Caste
Caste
Quote:
Original post by Toji
Cool! I've been wondering when these would come out. It's high time that NeHe be brought up to date. :)

Site Observations: (these are mostly nit-picky things)

* Under Firefox 3 the NeHe logo ends up partially obscured by the site text itself. I have a suspicion that this is because of Ad block, since when I view the site in IE7 (with ads) it shows up fine. Don't depend on your ads to push the text into the right place.

I know, but after refreshing the page this problem disappears so I have no idea what's the problem there

Quote:

* All of the code blocks have 1 line of empty space at their top, but none at the bottom. Pick one or the other, but having them mixed looks funny. (Sorry, I used to be a web designer. Can you tell?)

Code Observations:

* The directory structure in the downloaded zips seems a tad overwhelming and unnecessary to me, made more so by the fact that the lesson files cannot be extracted to the same place (Main.cpp would conflict, etc). New programmers will likely be interested in only one thing up front: the project file. It should be as easy to access as possible.

Thats true, we just need a nice way to package up things for windows as we have for linux, perhaps we'll reorganize it by then, we just wanted to get them released finally.
Quote:

* All of the folder names in the visual studio project are in German :) Nothing against Germany, but it seems odd for a tutorial written in English.

Sorry for that, I'll fix it..
Quote:

* The association between the "Lesson" and "Window" classes is very loose, but they are extremely interdependent on each other, specifically when it comes to the SDL components. It seems odd, for example, that while the Window class creates the SDL environment, the Lesson class is what handles all of the messages for it. This takes advantage of the fact that SDL (like OpenGL) is a C library and globally accessible, but it breaks strict object-orientation and would not work (well) for other scenarios. i.e: If one were to try to port these tutorials to DirectX the class layout would become unruly fast. Quite frankly, I'm not sure why they have to be two separate classes at all, since the Lesson doesn't do much on its own. If they are going to be separate I feel like inheriting Lesson from Window may make a bit more sense. That way everything is working in an explicitly shared space instead of an implicitly shared one.

Well to be honest, providing code which might be easily ported to DX was not our intention, but to seperate the SDL specific code from the OpenGL and drawing part. Yeh event handlinc crosses the cut here, but that seemed to be a more appropriate solution to achive our goal.
Quote:

* This may just be me, by I pointed the code at my pre-existing SDL installation (1.2, I believe) and found that I had to change all the SDL includes from to simply in order to compile. My release simply wasn't organized that way.

Dunno, I installed SDL for Code::Blocks and VisualStudio and it was structured that way (version 1.2 too)
Quote:

* Under Windows the tutorial launches a console before the window. That can be nice for debugging, but I think you'll turn a lot of people off with it. At least have a tutorial that shows how to launch SDL without it. (And if you're not sure how, give me a shout. It's just some configuration fluff.)

Hmm right, forgot that. This was something with mainCRTstartup as entry point, right?
Quote:

* I applaud your decision to move away from immediate mode rendering, and I like the decision to use vector::push_back for geometry setup, since that will give a bit of familiarity to those who already know the immediate mode calls. I somewhat question the decision to use Vertex Arrays instead of VBOs, however. While there's no question that Vertex Arrays are a big step up from immediate mode, I think that they're becoming obsolete fast. OpenGL 3 isn't going to support them (IIRC), and DirectX has always discouraged it's equivalent functionality. I'd just hate to see the tutorial life artificially limited because of this choice. (Although I can agree that it is more clear for new developers. *sigh*)

Well as vertex arrays can be handled pretty much the same as VBOs we wanted to start with those, next lessons will introduce texturing and vbos and from then on we'll only use these.
Quote:

I'll play around with them some more and see if I find anything new, these are just "first-glance" impressions.

I hope I don't come off as harsh, since I think it's great that there's a movement to inform people about better OpenGL usage. I want these tutorials to succeed, so if any of my comments seem overtly critical it's only because I would hate to see a little problem on my end turn into a deal-breaking frustration for someone new to the field.

Best of luck with these tutorials, and may you see just as much success as Jeff did!

Thx a lot for your constructive criticizm, thats always welcome! And you're also welcome to help with the lessons if that'd satisfy your wish of seeing them succeed [wink].

Cheers
Carsten
Eckos
Eckos
When you start one more advanced topics. Try and break down each code and explain in more indepth. I've noticed that in your other old tutorials, you didn't really do well with that.Too bad you didn't go with Qt4 ;).

I think Glew would be a much better than Glee.

Is there a possiblity to have some GLSL tutorials also? You lacked that in the old ones.

Will you allow different source codes to be done similar to yours but in different api again?

And thank you from moving away from WinAPI *bows*

I noticed that you use Color in your api. But use the word colour describing what's going on.

[Edited by - Eckos on June 14, 2008 3:06:17 AM]
Toji
Toji
Good to see that you're keeping an ear out to the community!

Quote:
Original post by Caste
Thats true, we just need a nice way to package up things for windows as we have for linux, perhaps we'll reorganize it by then, we just wanted to get them released finally.


No harm in that, but it's good to know you're thinking about it.

Quote:
Dunno, I installed SDL for Code::Blocks and VisualStudio and it was structured that way (version 1.2 too)


Nevermind. Looked at this one again and it's just me. Oops!

Quote:
Hmm right, forgot that. This was something with mainCRTstartup as entry point, right?


Yes, and don't forget to set the SubSystem to "Windows" (In Visual Studio anyway. Don't know about the others.)

Quote:
Well as vertex arrays can be handled pretty much the same as VBOs we wanted to start with those, next lessons will introduce texturing and vbos and from then on we'll only use these.


Fair enough, and I can agree that Vertex arrays are an easier concept to understand for beginners. And heck, ANYTHING is better than re-teaching immediate mode!

Quote:

Thx a lot for your constructive criticizm, thats always welcome! And you're also welcome to help with the lessons if that'd satisfy your wish of seeing them succeed [wink].


I'd love to help out any way I can! I was going to start my own tutorial series at one point, but life just kinda got in the way. *sigh* Let me know if there's anything I can do to help and I'd certainly be interested in doing a tutorial or two myself in the future!

// The user formerly known as Tojiro67445, formerly known as Toji [smile]
rip-off
rip-off
What libsdl.org says you should do about including SDL.h: here.
Kazade
Kazade
Hmm, what libsdl.org says is weird (to me at least) for 2 reasons:

1. Using quotes in an #include directive indicates that the header file can be found relative to the file containing the #include directive which is unlikely most of the time. Angle brackets indicate that it will search the paths passed into the compiler.

2. Most Linux distributions put the header in /usr/include/SDL/SDL.h. As /usr/include is on the path by default in most cases then the include becomes . It is the same with OpenGL itself (GL/gl.h)

I understand that the source code distribution of SDL does not contain an "SDL" subfolder. So I guess we are going against the grain here, but the method that we use is clean and consistent, you are of course welcome to just delete the SDL/ from your include directives [wink]

Member of the NeHe team.
rip-off
rip-off
They recommend that because (I think) it offers the most flexibility between different platforms. People can just dump the SDL headers into the same directory as their own source (even if it is a horrible thing to do) or they can use the preprocessor include directory directives (e.g. g++ -I/home/me/includes) without modifying the source.

Example: I have both SDL 1.2 and SDL 1.3 on my machine. I could choose which version a project is to include by changing my include path for that project, not the source. This is handy because SDL is included in a number of places, whereas my include search path is found in a single place.

SDL is all about source compatibility, and this seems to be the best way to do it.

Even though I agree with you about #1, I still follow their guidelines.
TobiO
TobiO
Quote:
Page Not Found

Why isn't it there anymore?
Caste
Caste
Good question, somehow all the content disappeared due to an error in the wiki, the pages are still there, though. I'll try to get it up and running again, otherwise I'll create some pages on the old NeHe site presenting the same content..
Smac
Smac
The download links for lesson 3 are pointing to the lesson 1 files.
Smac
Smac
Are you sure it was changed? I still see the lesson 1 files in the download links and the last edit of the lesson 3 page was 2008/06/13 10:53. Am I looking in the wrong place?
Caste
Caste
Dunno, I'm seeing lesson03.linux.zip and lesson03.win.cb.zip and so on.. Perhaps clear your cache and reload the site? Are you looking at the newest revision of the page (mine shows: Modified: 2008/06/17 07:51)
Smac
Smac
Actually, I wasn't noticing the "Current Revision" link, which I do see as 2007/06/17 07:51. However, for some reason the only thing I see on any of the current pages (anywhere in the wiki) are the revision history links. Any of the old revision links will display the actual page content, but not when I view the most current page. I am sure this is just something really silly on my part, but I haven't been able to figure it out yet. I am using Firefox on Linux to view the wiki.
Caste
Caste
The wiki is pretty weird sometimes. We're having troubles (ubuntu & FF) sometimes, too. Best working solution: disable cookies for this site.
We were getting redirected to the history page pretty often too, and that fixed it for me at least.
slvmnd
slvmnd
Great stuff!

(Although I would have gone with glfw instead of SDL.)
Wasteland Warriors - Multiplayer PC car battle gamestage3.se
android_808
android_808
I've been looking at through the base code and I must say I like how clean and simple it is thanks to SDL.

I note that you manually push a resize event to configure the viewport and perspective, but do not set the SDL window to be resizeable. Should the users of your lessons want to be able to resize the screen I think it would be nice to point out a couple of issues to potential users.

SDL seems to have a problem resizing SDL windows, where by unless a call to SDL_SetVideoMode is called the mouse movement at co-ordinates greater than the original size are undetected.

For example if a screen is resized from 640x480 to 800x600:
All movement where x > 640 returns 640
All movement where y > 480 returns 480
All movement where x > 640 and y > 480 returns diddly squat.

Using SDL_SetVideoMode will resolve this but introduces an issue where by the GL context is destroyed.

Unless a fix has been implemented recently this may catch a few people out.

Update: Been through the SVN mailing list and I think this was fixed as of revision 3572 from Wed Mar 12 15:01:48 PDT 2008.

"Don't recreate the GL content in windib target if SDL_SetVideoMode() is being called in response to a window resize event...prevents loss of GL state and objects."

Full details:
http://lists.libsdl.org/pipermail/svn-libsdl.org/2008-March/000622.html

[Edited by - android_808 on June 24, 2008 4:38:22 AM]
leeming
leeming
Quote:

If not, you probably need to set the path to the Platform SDK (if you haven't installed it, do that now!), I did. In VC, go to Extras->Options and choose Projects and Workspaces -> VC++ dirs . (Dunno whether its called exactly like that, I've got a german version) There you need to add \Include to the Include dirs and \Libs to your Library search path (the dropdown list to the upper left).


Can some one please explain this from the page "Setting up SDL with Visual Studio"?

I can not seem to be able to find an "Extras" menu. But have looked around to find similar menus and have got this far..

Tools > Options > Projects and Solutions > VC++ Directories ...
Added "\Include" into the "Include files" section (from the top right dropdown) and also added "\Libs" to the "Library files" section.

This still gives the following error messages on compile
"Cannot open include file: 'windows.h': No such file or directory"

Tried googling this but brings up alot of forum posts with people giving out of date (redirected) links.

Im sure im not the only person who will have this problem

Also as a comment about the wiki, i really dont like it. Having to click thru like 3 pages just to view a tutorial? (that version control thing is a little silly as the link at the top says some thing such as " Current Revision - 2008/06/13 09:53" yet when clicked on the same page is reloaded, and the next link down (most upto date release) is not even same date.
^conclusion, navigation is confusing and too long (old style of storing them was much much better.

Oh yes, and the NeHe banner is only half showing, rest of it is hiding behind the main content

*edit* im using Visual C++ 2005 (Since there doesnt seem to be much help with 2008)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.