Hello
I'm trying to render to texture using glCopyTexImage2D (like at NeHe's
tutorial). It works fine. I thought I could create larger view****t,
render, and then show that texture resized in window to get something
like resampling.
But I found the view****t can't be larger than my window and rest of
screen becomes black. Do you know what should I do to make it right?
First, I create DC like this:
h_DC := GetDC(Form1.Handle);
PixelFormat := ChoosePixelFormat(h_DC, @[EMAIL PROTECTED]
);
if (not SetPixelFormat(h_DC, PixelFormat, @[EMAIL PROTECTED]
)) then
exit;
h_RC := wglCreateContext(h_DC);
if (h_RC = 0) then
exit;
if (not wglMakeCurrent(h_DC, h_RC)) then
exit;
And this is rendering:
glView****t(0,0,1024,1024);
//here I draw something
glBindTexture(GL_TEXTURE_2D, RendTexture);
glCopyTexImage2D(GL_TEXTURE_2D,0,GL_RGB,0,0,rend_tekstura_x,rend_tekstura_y,1);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
//and again back to first view****t
glView****t(0,0,form1.ClientWidth,form1.ClientHeight);
It works great, but part of screen is black. The part larger than window.
Thanks ;)
G.


|