From f382c18643d16bf6656e508d611817aaf0c29704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20Ri=C3=9F?= Date: Sat, 16 Jan 2010 22:57:50 +0100 Subject: =?UTF-8?q?Bisschen=20ge=C3=A4ndert.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'main.cpp') 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 #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); -- cgit v1.2.3