Advertisement

Announcement: Beta code release

Started by March 03, 2007 09:11 AM
36 comments, last by Kazade 17 years, 6 months ago
lesson 4: yes normally m_trans does increase with the velocity over time.
But 3 rows down we manipulate the velocity in both magnitude and direction and this is what causes the bouncing effect, perhaps any problems you have are related to the problem below.

lesson 5: it should rotate from the beginning, maybe it has to do with the compiler, (hmm... strange it does so on my comp too, have to check the new code).
And F5 doesn't really compile, it debugs, and the executable is not run in the right folder for it to find the textures, hit F7 instead.

Well we will certainly look into this.
I know that the F5 was in the debug mode (well, I discovered the difference very recently actually =D ), what I meant is that I - as a avarage lazy guy that wanted everything to work with a click of the mouse - noticed that. Solving it was very easy, and I don't really think you guys should bother with it - I'm just pointing that other people will eventually run into the same problem that I did. But explaining the difference between debug-mode and actually compiling will work, I believe. Of course, I believe you guys are more interested in things more critical right now - I'll see if I find anything...

EDIT: I was playing a little with the Lesson5 code, and then I realised that the method void CNeheLessonFive::OnResize(int w, int h) was calling OnInitialize(); in the last line - I think this is why the texture was loaded multiple times. That function was not nescessary over there, because OnInitialize(); was already called somewhere else.

EDIT2: Actually, this didn't solved it, because the function is also called when the screen is set to fullscreen (or reset to windowed mode). Pressing spacebar calls the function CNeheWIN32Window::CreateGLWindow(...), that in turn will call CNeheWIN32Window::Initialize(), and then Initialize() will call CNeheLessonFive::OnInitialize() - every time we hit the spacebar. Just don't ask me how to solve this!

[Edited by - algumacoisaqualquer on July 6, 2007 9:00:52 AM]
Advertisement
I wish there was more RAII and less explicit uses of delete in the implementation. RAII is simple enough to introduce to a beginner. After all, if you are going to require C++ might as well get them on the right C++ track.
Programming since 1995.
I don't really like the method you've chosen for switching backends. Commenting and uncommenting lines is kinda... I don't know... primitive. I would have one wrapper function (CreateNeHeWindow()) which calls the correct platform-specific function based on a #define or a constant or something. I suppose your way is easier for beginners, but I find this to be helpful, especially when compiling for different targets (just add the proper #define to the build target). Just my 2 cents.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~I program in C++, on MSVC++ '05 Express, and on Windows. Most of my programs are also for windows.
Quote:
Original post by algumacoisaqualquer
EDIT: I was playing a little with the Lesson5 code, and then I realised that the method void CNeheLessonFive::OnResize(int w, int h) was calling OnInitialize(); in the last line - I think this is why the texture was loaded multiple times. That function was not nescessary over there, because OnInitialize(); was already called somewhere else.

EDIT2: Actually, this didn't solved it, because the function is also called when the screen is set to fullscreen (or reset to windowed mode). Pressing spacebar calls the function CNeheWIN32Window::CreateGLWindow(...), that in turn will call CNeheWIN32Window::Initialize(), and then Initialize() will call CNeheLessonFive::OnInitialize() - every time we hit the spacebar. Just don't ask me how to solve this!


OnInitialize in the OnResize was a bug, it should never have been there. Just delete it.

Just so everyone knows, I think the lessons are on hold for now while we wait for OpenGL "Longs Peak", it would be silly to write lessons now only to have a new API coming out soon.
Member of the NeHe team.

This topic is closed to new replies.

Advertisement