Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > OpenGL 3D API > larger view****...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 4818 of 5017
Post > Topic >>

larger view****t than device context (DC)?

by GAD Zombie <zombie@[EMAIL PROTECTED] > Jun 30, 2008 at 10:16 AM

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.
 




 7 Posts in Topic:
larger viewport than device context (DC)?
GAD Zombie <zombie@[EM  2008-06-30 10:16:31 
Re: larger viewport than device context (DC)?
Wolfgang Draxinger <wd  2008-06-30 10:44:14 
Re: larger viewport than device context (DC)?
GAD Zombie <zombie@[EM  2008-06-30 12:06:02 
Re: larger viewport than device context (DC)?
Wolfgang Draxinger <wd  2008-06-30 12:39:09 
Re: larger viewport than device context (DC)?
fungus <openglMYSOCKS@  2008-06-30 09:55:58 
Re: larger viewport than device context (DC)?
GAD Zombie <zombie@[EM  2008-07-01 10:50:27 
Re: larger viewport than device context (DC)?
fungus <openglMYSOCKS@  2008-07-01 02:08:57 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 5:16:42 CST 2008.