Skip to main content
GameDev.net gamedev.net
🔒 Locked

2D Rendering (Window Resizing) Issue

Started by Etyrn Jun 8, 2006 at 1:13 AM 1 replies 350+ views
Original Post
Etyrn
Etyrn
Once again I'm confuzzled to all Heck and throw myself at the mercy of the programmers. 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.
wendigo23
wendigo23
Look into glViewport
Etyrn
Etyrn
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.