Commit f4482f23 authored by Steven Fuller's avatar Steven Fuller

* GL_EXT_shared_texture_palette

* A few cleanups to GL code
parent 22ab23a2
This diff is collapsed.
...@@ -25,7 +25,7 @@ SLFLAGS = $(LFLAGS) -lvga ...@@ -25,7 +25,7 @@ SLFLAGS = $(LFLAGS) -lvga
#XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXxf86dga #XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lXxf86dga
XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 XLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11
GLFLAGS = $(LFLAGS) `gtk-config --libs` # -L/usr/X11R6/lib -lX11 -lXi -lXext -lgdk -lgtk GLFLAGS = $(LFLAGS) `gtk-config --libs` # -L/usr/X11R6/lib -lX11 -lXi -lXext -lgdk -lgtk
GLLFLAGS = $(LFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lGL GLLFLAGS = $(LFLAGS) -L/usr/lib -L/usr/X11R6/lib -lX11 -lXext -lGL
NASM = nasm NASM = nasm
......
...@@ -3,6 +3,7 @@ TODO: ...@@ -3,6 +3,7 @@ TODO:
- With windowed systems, put paused in the title bar? - With windowed systems, put paused in the title bar?
+ Being in a text menu could be the "pause" + Being in a text menu could be the "pause"
- This would be fine for svgalib - This would be fine for svgalib
- What if the program is ran without a term? The user's fault?
* SVGAlib Hack: * SVGAlib Hack:
- Check to make sure linear addressing is supported - Check to make sure linear addressing is supported
- If SVGAlib does not support 512x384x256, allow the user to pan around - If SVGAlib does not support 512x384x256, allow the user to pan around
...@@ -21,7 +22,7 @@ TODO: ...@@ -21,7 +22,7 @@ TODO:
- When all drawing is implemented, remove any unnecessary state/matrix - When all drawing is implemented, remove any unnecessary state/matrix
changes. changes.
- Split up GLDraw.c - Split up GLDraw.c
- GL_EXT_shared_texture_palette - Is GL_REPLACE faster than GL_MODULATE for textures?
* Save/Load Games * Save/Load Games
- Menu code does not exist yet -- so just have a compiled in default save - Menu code does not exist yet -- so just have a compiled in default save
and load files and load files
...@@ -39,13 +40,14 @@ TODO: ...@@ -39,13 +40,14 @@ TODO:
- 11025 will probably be the best rate - 11025 will probably be the best rate
* Interface * Interface
+ Menus and dialog boxes + Menus and dialog boxes
+ Command line (temporary workaround for no menus). - Command line (temporary workaround for no menus).
- Resolution
- Difficulty
- Text only menus (similar to what snes9x has). - Text only menus (similar to what snes9x has).
- Would like to have a "lower level" X Toolkit, to provide menus and
dialog boxes, and various widgets, but I rather not be "forced" into
losing the ability to call Xlib functions directly.
* Different depths/visuals for software clients. * Different depths/visuals for software clients.
+ Different functions to draw with different bpps. + Different functions to draw with different bpps.
- 15 bpp uses same draw routes as 16 but different palette one - 15 bpp uses same draw routes as 16 but different set palette
+ not sure how to do palette fades + not sure how to do palette fades
- don't support them generally - don't support them generally
- MacPlay->Id Logo: have some sort of redraw. - MacPlay->Id Logo: have some sort of redraw.
...@@ -77,6 +79,9 @@ IDEAS: ...@@ -77,6 +79,9 @@ IDEAS:
- XXX: Load Previously Loaded Game - XXX: Load Previously Loaded Game
- XXX: Save Game to Previously used File - XXX: Save Game to Previously used File
- F10: Quit - F10: Quit
* Command Line
- Resolution
- Difficulty
* How about adding red/white shifts (from PC wolf3d)? So screen changes * How about adding red/white shifts (from PC wolf3d)? So screen changes
color when you are hit or pick up items. color when you are hit or pick up items.
......
...@@ -40,8 +40,12 @@ XVisualInfo *vi; ...@@ -40,8 +40,12 @@ XVisualInfo *vi;
GLXContext ctx; GLXContext ctx;
Atom wmDeleteWindow; Atom wmDeleteWindow;
#ifdef GL_EXT_shared_texture_palette
extern int UseSharedTexturePalette; extern int UseSharedTexturePalette;
extern PFNGLCOLORTABLEEXTPROC pglColorTableEXT; extern PFNGLCOLORTABLEEXTPROC pglColorTableEXT;
#endif
extern int CheckToken(const char *str, const char *item);
int attrib[] = { int attrib[] = {
GLX_RGBA, GLX_RGBA,
...@@ -63,6 +67,7 @@ int main(int argc, char *argv[]) ...@@ -63,6 +67,7 @@ int main(int argc, char *argv[])
XColor fg = { 0 }; XColor fg = { 0 };
char data[8] = { 0x01 }; char data[8] = { 0x01 };
char *display; char *display;
const char *ext;
int mask, major, minor, verbose = 0; int mask, major, minor, verbose = 0;
int opt; int opt;
...@@ -128,7 +133,7 @@ int main(int argc, char *argv[]) ...@@ -128,7 +133,7 @@ int main(int argc, char *argv[])
ctx = glXCreateContext(dpy, vi, NULL, True); ctx = glXCreateContext(dpy, vi, NULL, True);
if (ctx == NULL) { if (ctx == NULL) {
fprintf(stderr, "glx context create failed\n"); fprintf(stderr, "GLX context creation failed\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
...@@ -172,6 +177,18 @@ int main(int argc, char *argv[]) ...@@ -172,6 +177,18 @@ int main(int argc, char *argv[])
XMapWindow(dpy, win); XMapWindow(dpy, win);
XFlush(dpy); XFlush(dpy);
ext = (const char *)glGetString(GL_EXTENSIONS);
#ifdef GL_EXT_shared_texture_palette
UseSharedTexturePalette = 0;
if (CheckToken(ext, "GL_EXT_shared_texture_palette")) {
pglColorTableEXT = glXGetProcAddressARB((unsigned const char *)"glColorTableEXT");
if (pglColorTableEXT) {
UseSharedTexturePalette = 1;
printf("GL_EXT_shared_texture_palette found...\n");
}
}
#endif
InitData(); InitData();
SlowDown = 1; SlowDown = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment