Sign in to follow this  
Etyrn

2D Rendering (Window Resizing) Issue

Recommended Posts

Once again I'm confuzzled to all Heck and throw myself at the mercy of the programmers. <cough> Problem is window resizing. I'll try to explain the issue best I can... but I'm not one for creating a good visual thought. Basically... window is created. Looks fine... you pull it down, and the background doesn't resize... and sticks to bottom of the screen. You push screen up, and background starts sliding up from the bottom until it's past the title bar. You pull it right, and it resizes (you can see text stretch), but there's still a black barrier (picture stretches to right, but doesn't get larger). When I pull it left, it looks fine because it stretches left fine, though I doubt the barrier is moving left. Some help would be nice on this. o.o
#ifdef _DEBUG_CLIENT_
   bool renderBG()
#else
   void renderBG()
#endif
{
   int W = client->WindowSize.w;
   int H = client->WindowSize.h;
   glBindTexture(GL_TEXTURE_2D, bgTexture);

   glBegin(GL_QUADS);
      glTexCoord2i(0,0); glVertex2i(0,H);
      glTexCoord2i(1,0); glVertex2i(W,H);
      glTexCoord2i(1,1); glVertex2i(W,0);
      glTexCoord2i(0,1); glVertex2i(0,0);
   glEnd();

   #ifdef _DEBUG_CLIENT_
      return true;
   #endif
}

void windowResize(int w, int h)//(this function's called when window resizes)
{
   //gluOrtho2D(0,w,h,0);
   client->WindowSize.w = w;
   client->WindowSize.h = h;
}


That commented out gluOrtho2D was one of my possible bug fixes... but it just rendered once then whole screen went black. ANY and all help is appreciated, especially since I know you have to be pretty darn patient with such a dumb problem. So thanks in advance! -Etyrn P.S. It'd also be nice if anyone could tell me how to set a minimum window width and height. Thankens.

Share this post


Link to post
Share on other sites
Ahaha! Can't believe I was missing that. I guess that's what happens when you try to make a project from scratch and not referring to any of your tutorials. Working perfectly now. Thanks!

(@Anyone else, still need help on setting a minimum window size)


-Etyrn

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this