added a test blendpixel for opengl. No idea if it works

This commit is contained in:
Felix Wallin 2010-09-10 22:10:41 +02:00
parent b89be21749
commit 959f3a24c6
2 changed files with 11 additions and 3 deletions

View File

@ -3,9 +3,9 @@ SOURCES := *.c
CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L CFLAGS := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L
OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations
LFLAGS := -lSDL -lm -lbz2 LFLAGS := -lSDL -lm -lbz2
MFLAGS_SSE3 := -march=k8 -DX86 -DX86_SSE3 -msse3 MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=k8 -DX86 -DX86_SSE2 -msse2 MFLAGS_SSE2 := -march=native-DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=pentium3 -DX86 -DX86_SSE MFLAGS_SSE := -march=native -DX86 -DX86_SSE
FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2 FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -O2 -march=k8 -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2
COMPILER := gcc COMPILER := gcc
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2 LINUX_TARG := powder-64-sse2 powder-sse powder-sse2

View File

@ -967,6 +967,14 @@ inline void blendpixel(pixel *vid, int x, int y, int r, int g, int b, int a)
#endif #endif
{ {
#ifdef OpenGL #ifdef OpenGL
if(x<0 || y<0 || x>=XRES || r>=YRES)
return;
if(a!=255)
{
glBegin (GL_QUADS);
glColor4ub(r,g,b,a);
glVertex2i(x, y);
}
#else #else
pixel t; pixel t;
if(x<0 || y<0 || x>=XRES || y>=YRES) if(x<0 || y<0 || x>=XRES || y>=YRES)