OOP opengl.h opengl.cpp

Started by
10 comments, last by dynamo_wku 21 years, 1 month ago
Im trying to create a second window (for debug purposes) but i cant seem to get it to work right with the OOP basecode stuff... do i have to make a new COpenGL object? or can i just do another object.CreateGLWindow(...) ? either way it doesnt work for me...id like to mention im new to win32 stuff and not quit certain what the MSG and HINSTANCE and all that jazz does for windows programming... thanks dynamo
Advertisement
I think if you''re using visual c++ you can just start all your projects as win32 console apps. This creates a console window behind your main program. Then, to write to the console use cout or printf, whatever you want.
i am using visual c++ and my project is a win32 app...but the only window that pops up is the one i created...there is no console menu

also, with console i couldnt get a real time effect...i needed another window that sets there and spits out values like x and y coordinates and speeds as they change...
Hmmm, well, I got away from the visual c++ thing awhile ago and went to linux so i might not be remembering correctly but I think there is a straight up win32 app and a win32 console app that you can choose with the project creation wizard. This could be wrong however and you might have already chosen the console one. The other quick thing I can think of doing wouldn''t be as helpful to you since you couldn''t see the results while you were running your program, at least not in real-time would be to output your values with printf or cout, without any console up, this should be written to a file in your project directory called stdout.txt. You could check that out while you were running your program to see what''s happening debugging-wise. To do this, you don''t need to set anything up, just pring to stdout.
yeah...there are win32 and win console...but using openGL i dont think i can use console can i? not for sure on that one...and yeah, it wouldnt be that great to have to refresh a text file every other second to see what values have been printed...
I haven''t used the nehe basecode before but I know the console thing works just fine if you use straight up glut or sdl. You might want to try it with the basecode anyway, just for kicks.
this stuff is weird haha...very confusing...i understand most of the stuff the tutorials cover but when it comes time to add something to my own stuff i cant seem to figure it out...
yeah, understandable, as I said, I haven''t used the basecode before let alone looked at it. I am a fan of the tutorials in general though. I like the SDL or GLUT a lot because they''re fairly simple to get started with and cross platform. Most of the annoying low level stuff is taken care of by these libraries so I can worry about graphics and program logic.
Another thing that I forgot to add but I guess is implicit in the cross-platform aspect of SDL and GLUT is that I don''t have to know any windows api junk which is just fine with me. I''d rather let somebody else worry about that stuff. As it is though, I''m a linux man now anyway so those worries are gone.
What I do, is simply write my text class for putting text to the screen, and use that. Just draws whatever values I want it to write over my display, makes it very simple for checking variables. I also have a debug class, in which I can use to write out data if I need to. Both of those classes have a similar syntax to printf and can take an undefined number of variables, so printing chars, integers, hex, strings, etc are no problem. You''re going to want a text displaying class, or function sometime, so you might as well do that now, instead of wasting your time trying to get a second window working, since that will be useless in the future.

This topic is closed to new replies.

Advertisement