Added simple collision detection.

This commit is contained in:
sjbaker
2006-10-01 03:45:08 +00:00
parent 2aaab1ab1a
commit 9ebc440ee5
5 changed files with 329 additions and 153 deletions

View File

@@ -335,12 +335,14 @@ void FrameBufferObject::fillTexture ( float *data )
}
void FrameBufferObject::paint ()
void FrameBufferObject::prepare ( bool clear )
{
makeDestination () ;
glViewport ( 0, 0, width, height ) ;
if ( clear ) glClear ( GL_COLOR_BUFFER_BIT ) ;
glMatrixMode ( GL_PROJECTION ) ;
glLoadIdentity () ;
glOrtho ( -1, 1, -1, 1, -1, 1 ) ;
@@ -351,8 +353,11 @@ void FrameBufferObject::paint ()
glDisable ( GL_DEPTH_TEST ) ;
glDisable ( GL_CULL_FACE ) ;
glDisable ( GL_BLEND ) ;
}
void FrameBufferObject::fill ()
{
float s_min = 0.5f / (float) width ;
float s_max = (((float) width) - 0.5f) / (float) width ;
float t_min = 0.5f / (float) height ;