Remove the tests for GL_EXT_texture_object (only being done in the wgl
target anyway). And now the basic SDL OpenGL target works on Win32 too.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Although my SGL stub was building before, it was linked against the
X11 version of the GL libs, whereas libSDL was linked against the
apple version => random chaos!
Need to include <OpenGL/gl.h> instead of <GL/gl.h>, so use a
conditional define to do the (-DAPPLE_OPENGL in the Makefile). When
linking, use "-framework OpenGL" and not -lGL.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
8-bit paletted textures are deprecated functionailty (removed in
OpenGL 3.1 core) so probably not worth supporting them anymore. May be
worth looking at supporting a configuration where we do this via
shaders if the environment is particularly memory size or bandwidth
constrained.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Pass over the source and make as many references to entities as possible
const. This makes it much more obvious where we are actually making
modifications to the entity_t structure.
Mostly trivial, the only place where I did something other than add the
keyword "const" was in R_DrawBrushModel where we were working around the
reversed pitch bug.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
GLQuake had pretty much already implemented this with
GL_MakeAliasModelDisplayLists, but generalise it to use the model_loader_t
system and have the software render place it's internal details behind the same
interface.
Again I have introduced some limitations into the software renderer in the form
of the static arrays used to hold temporary data as we load the mesh (same a
glquake) - will attempt to get rid of these later.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Create a model loader structure which can be used to pass callbacks down
from the renderer code. This will allow us to have the render do some
processing on the loaded data at appropriate points and let us make the
actual loading code generic.
In the first instance, pass down the aliashdr_t padding value required by
the renderer.
Note that to remove a circular dependency introduced in the headers, I had
to stop including render.h in model.h/gl_model.h and that change
propogated some more changes to includes across the tree...
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Finally we can see that currententity is only ever written and not
read so it is safe to remove.
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
Some assumptions about the sky texture in a BSP being unique prevented bsps
with more than one sky texture working properly. Indeed, this could also cause
bad memory corruption when a face with the non-primary sky texture, having
extents greater than the maximum was dynamically lit. The blocklights array is
only sized appropriately for areas <= 256 texels.
Signed-off-by: Tyrann <tyrann@disenchant.net>
The multitexture sky drawing routines are working fine, so remove the cvar
that turns it on/off and always use it if multitexture is available.
Signed-off-by: Tyrann <tyrann@disenchant.net>
Rather than just assuming that the texture handles that we generate are okay
to use, use the proper glGenTextures function. Note that we're still leaking
textures all over the place (every map load, etc.) - proper texture management
is still needed.
Signed-off-by: Tyrann <tyrann@disenchant.net>
This patch sets things up to make use of the XFree86 gamma manipulation
functions.
One issue is that the OpenGL blending substitute we set up is not really the
same as gamma correction because it only brightens pixels according to their
current values. This means black areas are not brightened using this method
(which I think is a good thing), but gamma correction adds "white" to every
area of the screen.
At the moment I've set up the "manual" OpenGL version as a fallback in case
the system gamma functions are not working or not available. I've also set
things up such that the system gamma is not used unless we are in fullscreen
mode since it affects the whole display.
The cvar _gl_allowgammafallback controls whether the fallback is used or not,
but I don't currently have a way to force it to use the "fallback" even if the
other gamma settings work. Most likely I'll separate out the two functions
into gamma and "intensity" similar to Quake 2 and later games.
Signed-off-by: Tyrann <tyrann@disenchant.net>
APIENTRY is usually defined by windows.h - this seems to be the easiest way to
deal with it as long as it's only ever a #define elsewhere and not a typedef
or something wierd like that.
Signed-off-by: Tyrann <tyrann@disenchant.net>