Browse Source

Implement Video::GetWidth() and Video::GetHeight().

legacy
Sam Hocevar sam 14 years ago
parent
commit
d2e5bba88e
2 changed files with 17 additions and 0 deletions
  1. +15
    -0
      src/video.cpp
  2. +2
    -0
      src/video.h

+ 15
- 0
src/video.cpp View File

@@ -54,3 +54,18 @@ void Video::Clear()
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}

int Video::GetWidth()
{
GLint v[4];
glGetIntegerv(GL_VIEWPORT, v);
return v[2];
}

int Video::GetHeight()
{
GLint v[4];
glGetIntegerv(GL_VIEWPORT, v);
return v[3];
}


+ 2
- 0
src/video.h View File

@@ -17,6 +17,8 @@ class Video
public:
static void Setup(int width, int height);
static void Clear();
static int GetWidth();
static int GetHeight();
};

#endif // __DH_VIDEO_H__


Loading…
Cancel
Save