X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmodern%2Fmain.c;fp=src%2Fmodern%2Fmain.c;h=4115d5f9f1bc980825efd23cd27468e782d7edb7;hb=dbe159fcd090ca605fe8a45dea714760f430e237;hp=601b2ef5a528b9ef2f549b0d2d8c4ef400ab8bbe;hpb=7e576adc58f91db8dd89cffd1c4fd7401c70e36c;p=retroray diff --git a/src/modern/main.c b/src/modern/main.c index 601b2ef..4115d5f 100644 --- a/src/modern/main.c +++ b/src/modern/main.c @@ -20,6 +20,7 @@ along with this program. If not, see . #include #include "miniglut.h" #include "app.h" +#include "options.h" #include "rtk.h" #include "logger.h" @@ -52,7 +53,10 @@ static rtk_rect rband; int main(int argc, char **argv) { glutInit(&argc, argv); - glutInitWindowSize(640, 480); + + load_options(CFGFILE); + + glutInitWindowSize(opt.xres, opt.yres); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutCreateWindow("RetroRay"); @@ -109,21 +113,33 @@ void app_redisplay(int x, int y, int w, int h) void app_swap_buffers(void) { + glViewport(0, 0, win_width, win_height); + glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); + glOrtho(0, win_width, win_height, 0, -1, 1); - glRasterPos2i(-1, 1); + glRasterPos2i(0, 0); glPixelZoom(1, -1); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.5f); glDrawPixels(win_width, win_height, GL_BGRA, GL_UNSIGNED_BYTE, framebuf); glDisable(GL_ALPHA_TEST); + glDisable(GL_DEPTH_TEST); + glDisable(GL_LIGHTING); + glBegin(GL_LINE_LOOP); + glColor3f(1, 0, 0); + glVertex2f(0, 0); + glVertex2f(win_width, 0); + glVertex2f(win_width, win_height); + glVertex2f(0, win_height); + glEnd(); + if(rband.width | rband.height) { - glOrtho(0, win_width, win_height, 0, -1, 1); glPushAttrib(GL_ENABLE_BIT); glDisable(GL_DEPTH_TEST);