summaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorConstantin Riß <constantin.riss@dre.de>2010-01-16 22:57:50 +0100
committerConstantin Riß <constantin.riss@dre.de>2010-01-16 22:57:50 +0100
commitf382c18643d16bf6656e508d611817aaf0c29704 (patch)
tree2063914afb33989ec416e427d5c608eeba7f3282 /main.cpp
parentac9295f8f9ec5efa475fa8f2a56b3d975d6acc01 (diff)
downloadc3d-f382c18643d16bf6656e508d611817aaf0c29704.tar
c3d-f382c18643d16bf6656e508d611817aaf0c29704.zip
Bisschen geändert.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index 632c3b9..8d59951 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,5 +1,6 @@
#include "DisplayClass.h"
#include "gl.h"
+#include <cstdlib>
#ifdef _WIN32
#else
@@ -20,15 +21,15 @@ void resize(int width, int height);
void initGL(bool multisample) {
glClearColor(0.0, 0.0, 0.0, 1.0);//glClearColor(1.0, 0.85, 0.06, 1.0);
glClearDepth(1.0);
- //glEnable(GL_DEPTH_TEST);
- //glDepthFunc(GL_LEQUAL);
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_LEQUAL);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
#ifndef _WIN32
if(multisample)
- glEnable(GL_MULTISAMPLE_ARB);
+ glDisable(GL_MULTISAMPLE_ARB);
#endif
resize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
@@ -221,6 +222,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
}
}
+ void resize(int width, int height);
+
+ void initGL(bool multisample) {
+ glClearColor(0.0, 0.0, 0.0, 1.0);//glClearColor(1.0, 0.85, 0.06, 1.0);
+ glClearDepth(1.0);
delta = GetTickCount()-ticks;
if(delta < MIN_FRAME_DELTA) {
@@ -230,7 +236,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
ticks += delta;
- static DisplayClass render;
+ static DisplayClass render();
render.renderScene(delta);
SwapBuffers(hDC);
}
@@ -335,12 +341,17 @@ bool GLXinit(Display *disp, Atom windele, Window *wnd, GLXContext *gc, bool *mul
return ok;
}
-int main() {
+int main(int argc, char *argv[]) {
Display *disp = XOpenDisplay(0);
Atom windele = XInternAtom(disp, "WM_DELETE_WINDOW", False);
Window wnd;
GLXContext gc;
+ if(argc != 4) {
+ std::cerr << "Wrong paramter count" << std::endl;
+ return 1;
+ }
+
bool multisample;
if(!GLXinit(disp, windele, &wnd, &gc, &multisample))
return 1;
@@ -376,7 +387,7 @@ int main() {
if(!running) break;
- static DisplayClass render;
+ static DisplayClass render(std::atoi(argv[1]), std::atoi(argv[2]), std::atoi(argv[3]));
render.renderScene(delta);
glXSwapBuffers(disp, wnd);