mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
glx, gly, glwidth and glheight are now gone too. also GL_BeginRendering
This commit is contained in:
parent
ee0de1b4e1
commit
4b0320f341
9 changed files with 9 additions and 72 deletions
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
gl_textures.h
|
||||
|
||||
GL texture stuff from the renderer.
|
||||
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#ifndef __QF_GL_screen_h
|
||||
#define __QF_GL_screen_h
|
||||
|
||||
extern int glx, gly, glwidth, glheight;
|
||||
|
||||
#endif // __QF_GL_screen_h
|
|
@ -53,6 +53,5 @@ extern int tess;
|
|||
extern int gl_max_lights;
|
||||
|
||||
void GL_EndRendering (void);
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height);
|
||||
|
||||
#endif // __QF_GL_vid_h
|
||||
|
|
|
@ -13,8 +13,8 @@ nobase_pkginclude_HEADERS = \
|
|||
\
|
||||
GL/ati.h GL/defines.h GL/extensions.h GL/funcs.h GL/qf_explosions.h \
|
||||
GL/qf_funcs_list.h GL/qf_lightmap.h GL/qf_noisetextures.h \
|
||||
GL/qf_rlight.h GL/qf_rmain.h GL/qf_rsurf.h GL/qf_screen.h GL/qf_sky.h \
|
||||
GL/qf_textures.h GL/qf_vid.h GL/types.h \
|
||||
GL/qf_rlight.h GL/qf_rmain.h GL/qf_rsurf.h GL/qf_sky.h GL/qf_textures.h \
|
||||
GL/qf_vid.h GL/types.h \
|
||||
\
|
||||
plugin/cd.h plugin/console.h plugin/general.h plugin/input.h \
|
||||
plugin/snd_output.h plugin/snd_render.h
|
||||
|
|
|
@ -55,7 +55,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/funcs.h"
|
||||
#include "QF/GL/qf_rmain.h"
|
||||
#include "QF/GL/qf_rsurf.h"
|
||||
#include "QF/GL/qf_screen.h"
|
||||
#include "QF/GL/qf_textures.h"
|
||||
#include "QF/GL/qf_vid.h"
|
||||
#include "QF/GL/types.h"
|
||||
|
@ -797,7 +796,7 @@ Draw_FadeScreen (void)
|
|||
static void
|
||||
set_2d (int width, int height)
|
||||
{
|
||||
qfglViewport (glx, gly, glwidth, glheight);
|
||||
qfglViewport (0, 0, vid.width, vid.height);
|
||||
|
||||
qfglMatrixMode (GL_PROJECTION);
|
||||
qfglLoadIdentity ();
|
||||
|
|
|
@ -56,7 +56,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_rlight.h"
|
||||
#include "QF/GL/qf_rmain.h"
|
||||
#include "QF/GL/qf_rsurf.h"
|
||||
#include "QF/GL/qf_screen.h"
|
||||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
|
|
@ -57,7 +57,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/qf_rlight.h"
|
||||
#include "QF/GL/qf_rmain.h"
|
||||
#include "QF/GL/qf_rsurf.h"
|
||||
#include "QF/GL/qf_screen.h"
|
||||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
#include "compat.h"
|
||||
|
@ -462,7 +461,7 @@ R_SetupGL_Viewport_and_Perspective (void)
|
|||
h = r_refdef.vrect.height;
|
||||
}
|
||||
// printf ("glViewport(%d, %d, %d, %d)\n", glx + x, gly + y2, w, h);
|
||||
qfglViewport (glx + x, gly + y2, w, h);
|
||||
qfglViewport (x, y2, w, h);
|
||||
screenaspect = (float) r_refdef.vrect.width / r_refdef.vrect.height;
|
||||
MYgluPerspective (r_refdef.fov_y, screenaspect, r_nearclip->value,
|
||||
r_farclip->value);
|
||||
|
@ -920,7 +919,7 @@ static void
|
|||
R_RenderViewFishEye (void)
|
||||
{
|
||||
float s_fov_x, s_fov_y;
|
||||
int s_vid_w, s_vid_h, s_rect_w, s_rect_h, s_gl_w, s_gl_h;
|
||||
int s_vid_w, s_vid_h, s_rect_w, s_rect_h;
|
||||
|
||||
if (!R_InitFishEye()) return;
|
||||
|
||||
|
@ -931,13 +930,11 @@ R_RenderViewFishEye (void)
|
|||
s_vid_h = vid.height;
|
||||
s_rect_w = r_refdef.vrect.width;
|
||||
s_rect_h = r_refdef.vrect.height;
|
||||
s_gl_w = glwidth;
|
||||
s_gl_h = glheight;
|
||||
// the view should be square
|
||||
r_refdef.fov_x = r_refdef.fov_y = 90;
|
||||
vid.width = vid.height =
|
||||
r_refdef.vrect.height = r_refdef.vrect.width =
|
||||
glwidth = glheight = gl_cube_map_size;
|
||||
gl_cube_map_size;
|
||||
switch (scr_fviews->int_val) {
|
||||
case 6: R_RenderCubeSide (BOX_BEHIND);
|
||||
case 5: R_RenderCubeSide (BOX_BOTTOM);
|
||||
|
@ -953,8 +950,6 @@ R_RenderViewFishEye (void)
|
|||
vid.height = s_vid_h;
|
||||
r_refdef.vrect.width = s_rect_w;
|
||||
r_refdef.vrect.height = s_rect_h;
|
||||
glwidth = s_gl_w;
|
||||
glheight = s_gl_h;
|
||||
R_SetupGL_Viewport_and_Perspective ();
|
||||
qfglMatrixMode (GL_MODELVIEW);
|
||||
qfglCallList (fisheye_grid);
|
||||
|
|
|
@ -52,7 +52,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "QF/GL/funcs.h"
|
||||
#include "QF/GL/qf_rmain.h"
|
||||
#include "QF/GL/qf_rsurf.h"
|
||||
#include "QF/GL/qf_screen.h"
|
||||
#include "QF/GL/qf_textures.h"
|
||||
#include "QF/GL/qf_vid.h"
|
||||
|
||||
|
@ -85,39 +84,33 @@ R_Envmap_f (void)
|
|||
r_refdef.viewangles[0] = 0;
|
||||
r_refdef.viewangles[1] = 0;
|
||||
r_refdef.viewangles[2] = 0;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
qfglReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
QFS_WriteFile ("env0.rgb", buffer, sizeof (buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 90;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
qfglReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
QFS_WriteFile ("env1.rgb", buffer, sizeof (buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 180;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
qfglReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
QFS_WriteFile ("env2.rgb", buffer, sizeof (buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 270;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
qfglReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
QFS_WriteFile ("env3.rgb", buffer, sizeof (buffer));
|
||||
|
||||
r_refdef.viewangles[0] = -90;
|
||||
r_refdef.viewangles[1] = 0;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
qfglReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
QFS_WriteFile ("env4.rgb", buffer, sizeof (buffer));
|
||||
|
||||
r_refdef.viewangles[0] = 90;
|
||||
r_refdef.viewangles[1] = 0;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
qfglReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
QFS_WriteFile ("env5.rgb", buffer, sizeof (buffer));
|
||||
|
@ -232,7 +225,6 @@ R_TimeRefresh_f (void)
|
|||
|
||||
start = Sys_DoubleTime ();
|
||||
for (i = 0; i < 128; i++) {
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
r_refdef.viewangles[1] = i * (360.0 / 128.0);
|
||||
R_RenderView ();
|
||||
GL_EndRendering ();
|
||||
|
@ -241,8 +233,6 @@ R_TimeRefresh_f (void)
|
|||
stop = Sys_DoubleTime ();
|
||||
time = stop - start;
|
||||
Sys_DPrintf ("%f seconds (%f fps)\n", time, 128 / time);
|
||||
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
|
|
|
@ -64,8 +64,6 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "sbar.h"
|
||||
#include "view.h"
|
||||
|
||||
int glx, gly, glwidth, glheight;
|
||||
|
||||
/* SCREEN SHOTS */
|
||||
|
||||
VISIBLE tex_t *
|
||||
|
@ -143,11 +141,11 @@ SCR_ScreenShot_f (void)
|
|||
va ("%s/qf", qfs_gamedir->dir.def), ".tga")) {
|
||||
Sys_Printf ("SCR_ScreenShot_f: Couldn't create a TGA file\n");
|
||||
} else {
|
||||
buffer = malloc (glwidth * glheight * 3);
|
||||
buffer = malloc (vid.width * vid.height * 3);
|
||||
SYS_CHECKMEM (buffer);
|
||||
qfglReadPixels (glx, gly, glwidth, glheight, GL_BGR_EXT,
|
||||
qfglReadPixels (0, 0, vid.width, vid.height, GL_BGR_EXT,
|
||||
GL_UNSIGNED_BYTE, buffer);
|
||||
WriteTGAfile (pcxname->str, buffer, glwidth, glheight);
|
||||
WriteTGAfile (pcxname->str, buffer, vid.width, vid.height);
|
||||
free (buffer);
|
||||
Sys_Printf ("Wrote %s/%s\n", qfs_userpath, pcxname->str);
|
||||
}
|
||||
|
@ -210,7 +208,6 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs)
|
|||
if (!scr_initialized)
|
||||
return; // not initialized yet
|
||||
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
begun = 1;
|
||||
|
||||
if (r_speeds->int_val) {
|
||||
|
|
|
@ -613,14 +613,6 @@ GL_Init_Common (void)
|
|||
CheckLights ();
|
||||
}
|
||||
|
||||
VISIBLE void
|
||||
GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
*x = *y = 0;
|
||||
*width = vid.width;
|
||||
*height = vid.height;
|
||||
}
|
||||
|
||||
VISIBLE qboolean
|
||||
VID_Is8bit (void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue