Advertisement

Creating a window in OpenGL.

Started by February 15, 2002 03:16 PM
10 comments, last by Gothy 23 years ago
hi everybody, I just began reading through the tutorials on nehe.gamedev.net. Those are some really good tutorials but i have a couple of questions about it. I began with the first tutorial about creating a window, i understood not much of it so i continued to tutorial 2. That tutorial was easy to understand so i went on with the 3th and it was also very simple for me to understand. I also completed tutorial 4 and 5 also without problems. I then began reading through the 6th turorial about textures and that tutorial was also much more difficult to understand. Now i bought a book about c++ some weeks ago and i understand the subjects about: If, for while do and the things about cout and cin ofcourse and i know the basics about structures. I didn''t learn the things about pointers, strings, arrays, objects and the more advanced stuff about structures just yet. Is this the cause that i don''t understand how to make a window and will i be able to understand it if i read further in the book? I also want to ask if you opengl programmers understand how to write a code to make a window like the one discribed on nehe.gamedev.net or did you just learned al those things by heart? third thing i want to ask is how much slower is writing a program tottaly with glut then writing the same program totally in Opengl. thnx
First off, you don''t write a program in GLUT or OpenGL. You either:

1. Write a program using Win32 to make the window and OpenGL for rendering to it.

or

2. Use GLUT to handle the management of the window and OpenGL to render to it.

With that out of the way, you should use GLUT or some other windowing wrapper if you want cross-platform compatability (ie Mac, Linux, Windows), but if you''re just targeting Windows then you should probably learn Win32. Not just for windowing, but you''ll find the knowledge invaluable later on.

Oh and check the manuals too!

- Pete
Advertisement
thnx pete

So if i understand you right the window made on the site of nehe.gamedev.net was made with win32 programming. because i found another site wich described how to make a windows and he uses all kinds of commands starting with glut.

And then that 6th tutorial on nehe.gamedev.net. is that just opengl or is that also win32 programmed. I mean the code to check if a texture is loaded or if a texture excist on the harddrive.
When I first picked up the NeHe tutorials I was totally clueless on the window creation code because I hadn''t done much win32 programming. I just sort of accepted the code as "this is what works to create a window and start drawing" but I took some time occasionally to try and understand it. I''m no win32 guru now, but I definitely understand what''s happening in that tutorial 1 code.

I''d say it''s worth it to invest a little time in trying to understand the window creation stuff, it makes it much easier to modify NeHe''s basecode to your liking. You could, for instance, make an OO version if that''s more your style.

If learning that stuff is just too much of a hassle for you right now, then I''d have to agree with siaspete and say use GLUT. It simplifies a lot of tedious things like window creation, and it goes a long way towards making your code portable.
nehe mainly uses win32, it makes the code bulky
and for that u shud first refer to petzold, its the best book there is for win32.
as far as glut is concerned, it makes ur code short and fast
and for that refer to the book - OpenGL Programming guide 3/e
aka the OpenGL redbook its available freely on the net along with its sis - OpenGL Reference manual aka the OpenGL bluebook

if u r new to win32 , then stick to it, cover atleast half of petzold and then move over to glut.

i''m no guru myself but these steps worked just fine for me

P.S. if u don''t find petzold freely on the net, contact me, i''ll mail it over.
the full name is - Programming Windows 5/e by Charles Petzold

its a Microsoft Press book
Thnx all

I found that book that grafix mentioned. i read through the first chapter but they say that you must have a good understanding of the c language. the problem is that i only have an understandig of the c++ language. Do you think the book is still good for me then or must i find another book about windows programming?
Advertisement
C is C++, but without classes. So it should be easy to understand.
Yes i know c++ is an newer version of c (c++ ) but i read the first command and in c they use printf and in c++ they use cout << .Well it''s easy to understand the difference but what about pointers aren''t they programmed in another way then c++ and what about the header files?
What''s the problem? C has pointers too, and header files.
yes i know but arent they used in another way, i suppose so.


Edited by - Gothy on February 17, 2002 4:51:01 PM

This topic is closed to new replies.

Advertisement