@@ -580,16 +580,15 @@ sub ourBuildTextures
580
580
($FrameBufferID ) = glGenFramebuffersEXT_p(1);
581
581
($RenderBufferID ) = glGenRenderbuffersEXT_p(1);
582
582
583
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, $FrameBufferID );
584
- glBindTexture(GL_TEXTURE_2D, $TextureID_FBO );
585
-
586
583
# Initiate texture
584
+ glBindTexture(GL_TEXTURE_2D, $TextureID_FBO );
587
585
glTexImage2D_c(GL_TEXTURE_2D, 0, $Tex_Type , $Tex_Width , $Tex_Height ,
588
586
0, $Tex_Format , $Tex_Size , 0);
589
587
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
590
588
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
591
589
592
590
# Bind texture/frame/render buffers
591
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, $FrameBufferID );
593
592
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
594
593
GL_TEXTURE_2D, $TextureID_FBO , 0);
595
594
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, $RenderBufferID );
@@ -713,8 +712,9 @@ sub cbRenderScene
713
712
{
714
713
$FBO_rendered = 1;
715
714
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, $FrameBufferID );
715
+ glViewport(0, 0, $Tex_Width , $Tex_Height );
716
716
glPushMatrix();
717
- glTranslatef(-0.35, -0.48 , -1.5);
717
+ glTranslatef(0, 0 , -1.5);
718
718
glRotatef($Teapot_Rot --, 0.0, 1.0, 0.0);
719
719
glClearColor(0, 0, 0, 0);
720
720
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -739,8 +739,8 @@ sub cbRenderScene
739
739
}
740
740
741
741
glColor3f(1.0, 1.0, 1.0);
742
- # glutSolidTeapot(0.125 );
743
- glutWireTeapot(0.125 );
742
+ # glutSolidTeapot(0.25 );
743
+ glutWireTeapot(0.25 );
744
744
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
745
745
746
746
if ($hasFragProg )
@@ -845,6 +845,7 @@ sub cbRenderScene
845
845
846
846
847
847
# Render cube
848
+ glViewport(0, 0, $Window_Width , $Window_Height );
848
849
glEnableClientState(GL_VERTEX_ARRAY);
849
850
glEnableClientState(GL_NORMAL_ARRAY);
850
851
glEnableClientState(GL_COLOR_ARRAY);
0 commit comments