Jump to content

  • Log In with Google      Sign In   
  • Create Account


OpenGL Game Programming's ambiguous Chapter 2


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
14 replies to this topic

#1 Ghostface   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 September 2001 - 11:59 AM

I recently bought the book OpenGL Game Programming, and I''ve just completed reading Chapter 2. It seems to me that a few things aren''t explained in enough detail, such as the following...... 1.)I''ve seen quite a few Win32 tutorials, but none of them have ever explained this: exactly what in the world is a "handle"? They all use that term, but none of them define it in an easy-to-understand way. 2.) Page 46: "Several properties are assigned in the pixel format setup process, including color mode, depth buffer, bits per pixel, and whether the window is double-buffered." And no where are these terms explained; it''s all greek to me. Should I already know this stuff before moving on to OpenGL? Thanks in advance. ------------------------------- "A promise to a woman is just a lie that hasn''t happened yet." -Mr. Floppy

Sponsor:

#2 Drizzt DoUrden   Members   -  Reputation: 100

Like
Likes
Like

Posted 27 September 2001 - 12:07 PM

I agree, but they already had a huge book, and the purpose was to teach OpenGL not windows programming. I found this helpful:

www.winprog.org

It answers a few questions. Take the windows programming tutorials.

Also, you should get a Windows Programming book from a bookstore or amazon.com, so you know how to program the games a bit better. That would definately explain it all.

Edited by - Drizzt DoUrden on September 27, 2001 7:11:04 PM

#3 egonz   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 September 2001 - 12:26 PM

A handle is like an ID we can maipulate resources such as windows, controls, devices, etc. by they handle, I picture this in my mind a linked list where all the controls in windows are stored and the handle is the ID to addressed some control ( i don''t know if this is correct or not but i undertand handles in that way).

Double buffer is a memory buffer on where you dump all your pixels and when you finish you dump the double buffer contents to the monitor so you can avoid flicking.

Bits per pixel how many bits you use to create a color the more bits the more colors.
color mode RGB, RGBA each color an a computer screen is composed by 3 colors ( Red, Green, Blue ) in some proportion. the A leter is the alpha value of the color ( transpanrency ).

Check the OpenGL Bible Book for OpenGL Setup and some graphics book for concepts.

sorry for my bad writing but I''m in a hurry.


#4 Aprosenf   Members   -  Reputation: 372

Like
Likes
Like

Posted 27 September 2001 - 03:13 PM

A handle is a 32-bit variable that references a certain object in system memory. Although its value might me meaningless to you (e.g. 0xa201fe39), the system knows what to do with it when you pass a window handle to a system function or the likes. A word of caution - never manipulate handles on your own; you could get some strange results, although my best guess is that you would crash your program (I''ve never tried this, so correct me if I''m wrong). The color mode of a display setting is the number of bits used to represent the color of each pixel on the screen. The most common modes are 8-bit palleted, meaning the screen is like a color-by-numbers picture, where each pixel has a number 1-256, and a look-up table (LUT) contains the RGB values for all 256 colors, 16-bit 555 (5 red bits, 5 green bits, 5 blue bits, 1 extraneous bit), 16-bit 565 (6 green bits), 24-bit, and 32-bit ARGB/RGBA (A = aplha = transparency value). A depth buffer, also known as a z-buffer, stores the depth of each pixel for 3-d scene rendering. I don''t know too much about it. A double-buffered window means that there are two ''surfaces'' that you are drawing to. You draw to a hidden back buffer, and then each frame, you flip the surfaces to produce smoother animation than with single buffering. I hope that helps.

#5 Ghostface   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 September 2001 - 03:31 PM

Thanks for your posts everyone.

However...perhaps I should''ve let you know ahead of time that I am completely clueless to all things graphics-related. And I suppose that it doesn''t help that I haven''t gained a mastery over C++ yet (which I''ve been learning for a year).

In any case, I think I''ll be getting in bed soon. I''ll check back/write more later.

Thanks!

-------------------------------
"A promise to a woman is just a lie that hasn''t happened yet."
-Mr. Floppy

#6 Dave Astle   Senior Staff   -  Reputation: 2305

Like
Likes
Like

Posted 28 September 2001 - 07:45 AM

When we were told that we had to include introductory information on Win32 programming, we had a choice: provide really basic information and ask the readers to use it on more or less blind faith, or provide detailed coverage spanning several chapters. Since the latter would have required that we drop other chapters, we chose the former.

As far as the other issues, we had to make base assumptions about our readers. We assume that they have a good grasp of C++, and that they have at least a basic knowledge of the things involved in game development. It seems that most people who are into 3D gaming at all (and we''re not talking programming here, just gamers) would be familiar with many of the basic terms. If not, there are sites (such as our own Game Dictionary) that provide definitions.

In retrospect, perhaps we should have planned this to be two books from the very beginning, and made the first book a little more beginner-friendly.

#7 Drizzt DoUrden   Members   -  Reputation: 100

Like
Likes
Like

Posted 28 September 2001 - 08:33 AM

Myopic Rhino:

Didnt think it would be sp popular, huh?

#8 Ghostface   Members   -  Reputation: 122

Like
Likes
Like

Posted 30 September 2001 - 05:36 AM

Mr. Astle: Okay, now I understand. I wish the book had had a section in the beginning telling the assumptions that the authors had made.

#9 Dave Astle   Senior Staff   -  Reputation: 2305

Like
Likes
Like

Posted 30 September 2001 - 07:18 AM

quote:
Original post by Drizzt DoUrden
Didnt think it would be sp popular, huh?
No, we thought it would be fairly popular actually. The reason we never considered doing two volumes was that we didn''t think we''d ever want to write another book. A lot of time and effort went into the first, and we didn''t think we''d want to go through all that again.


#10 Dave Astle   Senior Staff   -  Reputation: 2305

Like
Likes
Like

Posted 30 September 2001 - 07:21 AM

quote:
Original post by Ghostface
Mr. Astle: Okay, now I understand. I wish the book had had a section in the beginning telling the assumptions that the authors had made.
Heh, who calls me Mr. Astle? I could have sworn that the book had something at the front indicating the intended audience. I can remember writing something about it. But I looked and there''s nothing there. Anyway, I hope you''re able to work through the rest of it okay.



#11 Khawk   Senior Staff   -  Reputation: 1360

Like
Likes
Like

Posted 01 October 2001 - 04:06 PM

I checked because I thought you wrote something too, but there''s nothing. There''s a brief mention that we assume people are familiar with C++, but it''s right before discussing something.

Kevin

#12 Ghostface   Members   -  Reputation: 122

Like
Likes
Like

Posted 02 October 2001 - 10:46 AM

I''ve been really busy lately, but recently I took the time to sit down and read chapter three. Even though some of the explanations were quite incomprehensible (like, why are normalized vectors so imporant? but then again, i don''t know much), I moved through it and had an ok grasp on just about everything. Then, I got to a page where it mentioned that you should know trigonometry, and I just about screamed in frustration, because I haven''t had trig yet. So, I suppose this is a message from God telling me not to learn OpenGL. Or, at least that would be a convenient excuse for giving up.

In any case, I suppose I''ll just have to let the book gather a little bit of dust on my shelf until I do two things: learn the basics of Windows programming and understand all of its concepts, and learn trig.

PLEASE, if you guys write another book, be sure to include a "What you need to know" or "Authors'' assumptions" page at the beginning.



P.S. Do I need to know linear algebra? If so, I''m worse off than I thought.

-------------------------------
"A promise to a woman is just a lie that hasn''t happened yet."
-Mr. Floppy

#13 Khawk   Senior Staff   -  Reputation: 1360

Like
Likes
Like

Posted 02 October 2001 - 04:10 PM

I suppose we COULD have had an appendix on trigonometry, but we were trying to make the schedule. In response to the two topics you feel you should know for 3D graphics - don''t worry about Windows, just know the basics; you need to have an idea on trigonometry to do anything seriously useful. That would actually apply to anything geometrical.

Kevin

#14 Facehat   Members   -  Reputation: 696

Like
Likes
Like

Posted 03 October 2001 - 05:40 AM

Trigonometry is great to know, but its not really essential for 3D programming. I still haven''t taken it and I''ve been working with 3D APIs for about a year now . I wouldn''t stop learning OpenGL just because you don''t know it, for the most part you only need the trigonometry for rotations and some collision detection stuff, so you can probably sneak by as long as you understand what the functions are doing -- even if you don''t fully understand the math. Yeah, I know thats not the best way to go about learning things, but its better than not learning at all.

Of course, its not bad to study the math a bit on your own before you take a class on it.

---------------------------
FaceHat Software -- Wear the hat.

#15 Ronin_54   Members   -  Reputation: 122

Like
Likes
Like

Posted 04 October 2001 - 08:27 AM

Well, the thing I found most usefull after reading the book, was teachers at school... Math teachers... Finally found a use for them, since Vector and Plane calculations are no longer handled in our Math classes... Though, old teachers tend to have very usefull books around, on just about any topic...




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS