so everytime you change the translate for the cube, it redraws, cuz theres a difference between your entire screen translating and just the cube
so everytime you change the translate for the cube, it redraws, cuz theres a difference between your entire screen translating and just the cube
You need to redraw it yourself.
STL Util a small headers-only library with various utility functions. Mainly for fun but feedback is welcome.
There is no such thing as "change the translate for the cube" in openGL because there is no cube within opengl. All that's within opengl is the matrix stack (position/rotation/scale). Nothing is there until you give it drawing instructions.Originally Posted by Shamino
"You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter
this thread has gone completely offtopic...
I really think you have no Idea at all what I'm talking about, and nor do I you....
Last edited by Shamino; 05-25-2005 at 10:55 AM.
Listen. It's simple.
- Draw everything in memory
- Blit everything from memory to screen
- Wash, rinse, repeat ad nauseum
Translating an object and all of those topcis are simple, very simple, 3D graphics fundamentals. If you do not understand them I suggest reading a book about 3D mathematics. There is no way possible we could explain 3D in one thread. Do yourself a favor and drop the game idea for now, purchase a book or two, and when you have compiled enough 3D knowledge....apply it and create your game.
Otherwise all of our posts will just lead to more questions.
I understand perfectly translating 3d objects and drawing them n everything, i made pong! :d but what you are suggesting is something i've never done before
Based on your responses in this thread I don't think you do.I understand perfectly translating 3d objects and drawing them n everything, i made pong! :d but what you are suggesting is something i've never done before
Evryone knows about double buffering and yet you act as if it is a foreign topic here. Also you want to perform everything on the front buffer - as in erasing rows of blocks, etc. That is not the proper way to use OpenGL.
In Direct3D you would have to do the following to get a pointer to the front buffer.
- Get an interface pointer to the swap chain.
- Get an interface pointer to the front buffer via the swap chain interface
- Get a pointer to the actual surface that is the front buffer by locking the surface.
- Render to the front buffer
- Unlock the front buffer
This would result in major slowdowns. Anytime you must lock the buffer, you are probably not doing something right. And while steps 1 and 2 can be done beforehand and are not required each frame, locking and unlocking the buffer even just once per frame is too much.
Everything in computer graphics is done via the back buffer. You render to the back buffer and then present it to the front buffer.
Last edited by VirtualAce; 05-25-2005 at 05:26 PM.
ahhh, the buffers are foreign to me, this is true, I know how to draw objects, yes... but the buffer thingy is quite foreign to me...
I understand what you are saying bubba i think... the back buffer is kinda like what you have drawn into memory, and the front buffer is only things you want to bring out of memory onto the actual screen... You are correct, I have been doing it wrong, I've been doing everything on the front buffer, nothing has been thrown into memory except for textures...... Thanks for this insight
when I learned how to draw objects from NeHe, (up to lesson 7 now) he never explained drawing objects to the back buffer and then presenting them to the front buffer like that... Maybe i'm just not far enough along.....
I've been using OpenGL like turbo C++ graphics
Last edited by Shamino; 05-26-2005 at 10:43 AM.
OpenGL does that for you. There is no need to worry about backbuffer and stuff, NeHe's tutorials does exactly that.
with call to any of the glVertex functions you draw to the backbuffer, this is then braught to the front when you call SwapBuffer (I think it is).
STL Util a small headers-only library with various utility functions. Mainly for fun but feedback is welcome.
I think it is automatically drawn on the front though, i'm thinking my problem includes taking things from the front buffer if I don't need them on the screen
You don't want to do that!Originally Posted by Shamino
Draw EVERYTHING to the back buffer
swap buffers (back buffer becomes the front buffer (is drawn to the screen)
repeat.
No! OpenGL automatically draws to the back-buffer!! Try this so you can actually see that this is true: Comment out the call to the function SwapBuffers, then you will see that nothing gets drawn, sooooo that means it has been drawn to the backbuffer and is then braught to the front when you call SwapBuffers!
STL Util a small headers-only library with various utility functions. Mainly for fun but feedback is welcome.
I don't even know how to just draw to the backbuffer...
So confused, can someone take this to instant messager with me, or private messages?
IM me at Shamino45...
or PM me with a little help
But for [beep] sake!!!! YOU DRAW TO THE BACKBUFFER ALREADY!!!! OPENGL DOES THIS FOR YOU!!!!! You dont need to worry about this.
STL Util a small headers-only library with various utility functions. Mainly for fun but feedback is welcome.
Haha, no one is going to want to talk to you via IM because you just can't seem to grasp the basics! Re read this whole thread and read it over and over until you understand. Then if you have another question, ask.