27 Commits

Author SHA1 Message Date
Kevin Shanahan
e3ab0af17f gl: minor cleanup of GL header compat code
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-03-16 10:53:24 +10:30
Kevin Shanahan
510714db69 model: pass the hunk alloc name for GL_SubdivideSurface
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2013-01-04 21:54:04 +10:30
Kevin Shanahan
158d64d15c vid: Expect at least OpenGL 1.1 and glBindTexture
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>
2012-12-11 19:52:28 +10:30
Kevin Shanahan
5bfacc3b50 build: use the Apple OpenGL framework for non-X11 OS X targets
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>
2012-12-11 16:21:30 +10:30
Kevin Shanahan
6f999fac2e gl: rip out support for OpenGL palettized textures
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>
2012-12-11 12:47:19 +10:30
Kevin Shanahan
a475651b54 entities: push down constness of entities where possible
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>
2012-11-25 15:49:46 +10:30
Kevin Shanahan
c7c0eab180 model: allow any origin/angles for R_RotateForEntity
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-24 16:32:04 +10:30
Kevin Shanahan
acfc75321e model: remove gl_model.h and use model.h everywhere
Gets rid of a bunch of conditionals throughout the .c files as well.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-11-19 13:22:30 +10:30
Kevin Shanahan
233aa47965 model: hand off alias mesh data loading to helper
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>
2012-11-19 11:18:36 +10:30
Kevin Shanahan
1a128ddfbf model: create a model loading helper
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>
2012-11-18 18:32:30 +10:30
Kevin Shanahan
f1ac2404a2 model: constify Mod_LoadAliasFrame input argument
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-29 11:10:21 +10:30
Kevin Shanahan
d8885d88ba model: pass poseverts down to GL_MakeAliasModelDisplayLists
Make globals "poseverts" and "posenum" local to gl_model.c

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 12:44:47 +10:30
Kevin Shanahan
2abce220c1 model: pass tris and verts down to GL_MakeAliasModelDisplayLists
Make globals "triangles" and "stverts" local to gl_model.c

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 12:32:18 +10:30
Kevin Shanahan
77f2154ece gl: expose gl_subdivide_size in glquake.h
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 12:05:10 +10:30
Kevin Shanahan
41b71e27a5 model: pass loadmodel down into GL_SubdivideSurface
Last external user of loadmodel, so can mark it static

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-28 11:59:02 +10:30
Kevin Shanahan
a3892ec40d render: Remove global currententity
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>
2012-10-22 13:40:58 +10:30
Kevin Shanahan
c7c7061c26 render: pass currententity down to R_RenderBrushPoly
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
2012-10-22 12:00:57 +10:30
Tyrann
1bb07a24a0 Remove unneeded alpha parameter to GL_Upload8_EXT 2011-12-28 10:48:15 +10:00
Tyrann
58310474ef [PATCH] Make bsps with more than one sky texture work properly in glquake
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>
2007-08-12 14:36:09 +09:30
Tyrann
5dfb0723ad [PATCH] Remove unneeded glu.h include
Signed-off-by: Tyrann <tyrann@disenchant.net>
2007-08-12 11:12:27 +09:30
Tyrann
aa84c0d8f7 [PATCH] remove _gl_lightmap_sort cvar
Benchmarking didn't show any noticable difference, so removing this cvar and
code path.

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-16 07:05:48 +09:30
Tyrann
aba56091ac [PATCH] Remove _gl_sky_mtex cvar
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>
2006-09-16 07:05:47 +09:30
Tyrann
e30996ce3a [PATCH] Use glGenTextures for texture handles
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>
2006-09-16 07:05:42 +09:30
Tyrann
e24ff3553f [PATCH] Use XF86 "Vidmode" gamma extension
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>
2006-09-10 19:06:07 +09:30
Tyrann
fbe64f6157 [PATCH] GL_MAX_TEXUTRE_UNITS compat fix
Compatibility fix for GL_MAX_TEXTURE_UNITS (only defined since OpenGL
API version 1.3)

Signed-off-by: Tyrann <tyrann@disenchant.net>
2006-09-10 19:06:04 +09:30
Tyrann
bd9dcd087d [PATCH] APIENTRY cleanup
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>
2006-09-10 19:05:57 +09:30
Tyrann
130e22195a Import v0.47 sources 2006-09-10 19:02:51 +09:30