From 33db9e22f70a19b1c1b18f39d023d85d2d133cb4 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 1 Sep 2010 14:49:45 +0100 Subject: [PATCH] Starting work on OpenGL --- graphics.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++- graphics.h | 6 +++++ main.c | 4 +++ powder.h | 52 ++++++++++++++++++------------------- 4 files changed, 110 insertions(+), 27 deletions(-) diff --git a/graphics.c b/graphics.c index fa742bebd..851e152a1 100644 --- a/graphics.c +++ b/graphics.c @@ -1,6 +1,17 @@ #include #include #include + +#ifdef OpenGL +#ifdef MACOSX +#include +#include +#else +#include +#include +#endif +#endif + #include "defines.h" #include "air.h" #include "powder.h" @@ -105,10 +116,14 @@ void sdl_blit_2(int x, int y, int w, int h, pixel *src, int pitch) void sdl_blit(int x, int y, int w, int h, pixel *src, int pitch) { +#ifdef OpenGL + RenderScene(); +#else if(sdl_scale == 2) sdl_blit_2(x, y, w, h, src, pitch); else sdl_blit_1(x, y, w, h, src, pitch); +#endif } void drawblob(pixel *vid, int x, int y, unsigned char cr, unsigned char cg, unsigned char cb) @@ -1112,6 +1127,18 @@ void draw_parts(pixel *vid) int cr, cg, cb; float pt = R_TEMP; for(i = 0; i