windowed gl mode is now resizable via cursor.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@563 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
b48cc1ae58
commit
75c585e397
1 changed files with 13 additions and 7 deletions
|
@ -66,7 +66,7 @@ static float old_windowed_mouse = 0;
|
||||||
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | \
|
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | \
|
||||||
PointerMotionMask)
|
PointerMotionMask)
|
||||||
|
|
||||||
#define X_MASK (KEY_MASK | MOUSE_MASK | FocusChangeMask | VisibilityChangeMask)
|
#define X_MASK (KEY_MASK | MOUSE_MASK | ResizeRequest | StructureNotifyMask | FocusChangeMask | VisibilityChangeMask)
|
||||||
|
|
||||||
|
|
||||||
#ifdef WITH_VMODE
|
#ifdef WITH_VMODE
|
||||||
|
@ -94,8 +94,6 @@ extern float mouse_x, mouse_y;
|
||||||
extern float old_mouse_x, old_mouse_y;
|
extern float old_mouse_x, old_mouse_y;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int scr_width, scr_height;
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
float gldepthmin, gldepthmax;
|
float gldepthmin, gldepthmax;
|
||||||
|
@ -356,6 +354,14 @@ static void GetEvent(void)
|
||||||
XNextEvent(vid_dpy, &event);
|
XNextEvent(vid_dpy, &event);
|
||||||
|
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
|
case ResizeRequest:
|
||||||
|
glwidth = event.xresizerequest.width;
|
||||||
|
glheight = event.xresizerequest.height;
|
||||||
|
break;
|
||||||
|
case ConfigureNotify:
|
||||||
|
glwidth = event.xconfigurerequest.width;
|
||||||
|
glheight = event.xconfigurerequest.height;
|
||||||
|
break;
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
Key_Event(XLateKey(&event.xkey), event.type == KeyPress);
|
Key_Event(XLateKey(&event.xkey), event.type == KeyPress);
|
||||||
|
@ -566,8 +572,8 @@ GL_BeginRendering
|
||||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||||
{
|
{
|
||||||
*x = *y = 0;
|
*x = *y = 0;
|
||||||
*width = scr_width;
|
*width = glwidth;
|
||||||
*height = scr_height;
|
*height = glheight;
|
||||||
|
|
||||||
// if (!wglMakeCurrent( maindc, baseRC ))
|
// if (!wglMakeCurrent( maindc, baseRC ))
|
||||||
// Sys_Error ("wglMakeCurrent failed");
|
// Sys_Error ("wglMakeCurrent failed");
|
||||||
|
@ -761,8 +767,8 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
|
|
||||||
qglXMakeCurrent(vid_dpy, vid_window, ctx);
|
qglXMakeCurrent(vid_dpy, vid_window, ctx);
|
||||||
|
|
||||||
scr_width = info->width;
|
glwidth = info->width;
|
||||||
scr_height = info->height;
|
glheight = info->height;
|
||||||
|
|
||||||
if (vid.conheight > info->height)
|
if (vid.conheight > info->height)
|
||||||
vid.conheight = info->height;
|
vid.conheight = info->height;
|
||||||
|
|
Loading…
Reference in a new issue