X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fglut%2Fmain.c;h=8d191923e052db7b0a006e8f1eb30e195e995fa6;hb=fb3df30d97e3824335a6c17fd8d49b9706b6b3c7;hp=0e766bdc6860ebe0eeb52aa7606bb33a9b6bc255;hpb=09e214b94e007964189222cca1e655f3aaefaf90;p=dosdemo diff --git a/src/glut/main.c b/src/glut/main.c index 0e766bd..8d19192 100644 --- a/src/glut/main.c +++ b/src/glut/main.c @@ -11,6 +11,7 @@ #include "cfgopt.h" #include "cgmath/cgmath.h" #include "util.h" +#include "cpuid.h" static void display(void); static void idle(void); @@ -73,7 +74,12 @@ static cgm_quat rot = {0, 0, 0, 1}; int main(int argc, char **argv) { glutInit(&argc, argv); - glutInitWindowSize(800, 600); + + if(glutGet(GLUT_SCREEN_HEIGHT) <= 1024) { + glutInitWindowSize(640, 480); + } else { + glutInitWindowSize(1280, 960); + } glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE); glutCreateWindow("Mindlapse"); @@ -96,6 +102,9 @@ int main(int argc, char **argv) glEnable(GL_TEXTURE_2D); glEnable(GL_CULL_FACE); + if(read_cpuid(&cpuid) == 0) { + print_cpuid(&cpuid); + } if(!set_video_mode(match_video_mode(FB_WIDTH, FB_HEIGHT, FB_BPP), 1)) { return 1; @@ -117,14 +126,21 @@ int main(int argc, char **argv) return 1; } time_msec = 0; - if(demo_init(argc, argv) == -1) { + if(demo_init1(argc, argv) == -1) { return 1; } - atexit(demo_cleanup); if(opt.fullscreen) { set_fullscreen(opt.fullscreen); + reshape(glutGet(GLUT_SCREEN_WIDTH), glutGet(GLUT_SCREEN_HEIGHT)); + } else { + reshape(glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT)); + } + + if(demo_init2() == -1) { + return 1; } + atexit(demo_cleanup); reset_timer(); @@ -232,6 +248,8 @@ void blit_frame(void *pixels, int vsync) prev_vsync = vsync; } + demo_post_draw(pixels); + for(i=0; i