summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2010-05-17 17:10:54 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2010-05-17 17:10:54 +0200
commitee4c9026e88b5251ece5f81b1101507f9408fa8a (patch)
treeeed59777e8365aa72bf4ce043874f6a3bdd7bf4c
parent3506d3df9f2e929def5b1662e08481d28643358f (diff)
Created seperate viewports.
-rw-r--r--main.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index 998adf0..f301ea2 100644
--- a/main.cpp
+++ b/main.cpp
@@ -180,6 +180,10 @@ int main(int, char**) {
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glViewport(-10, -10, 660, 740);
+ glScissor(0, 0, 640, 720);
+ glEnable(GL_SCISSOR_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@ -220,7 +224,7 @@ int main(int, char**) {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- glOrtho(0, 100, 0, 100, 0, 10);
+ glOrtho(-10, 110, -10, 110, 0, 10);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -243,7 +247,17 @@ int main(int, char**) {
glDisable(GL_TEXTURE_2D);
glUseProgram(0);
+
+ glDisable(GL_SCISSOR_TEST);
+ glViewport(640, 0, 640, 720);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, 100, 0, 100, 0, 10);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
glColor4f(1, 1, 1, 1);
char s[0xff];