Commit graph

24 commits

Author SHA1 Message Date
Daniel Gibson
ae63021d00 Add absolute mouse mode and refactor mouse grabbing code
There were lots of places in the code that called Sys_GrabInput(),
some of them each frame.
Most of this is unified in events.cpp now, in handleMouseGrab() which
is called once per frame by Sys_GenerateEvents() - this makes reasoning
about when the mouse is grabbed and when not a lot easier.
Sys_GrabInput(false) still is called in a few places, before operations
that tend to take long (like loading a map or vid_restart), but
(hopefully) not regularly anymore.

The other big change is that the game now uses SDLs absolute mouse mode
for fullscreen menus (except the PDA which is an ugly hack), so the
ingame cursor is at the same position as the system cursor, which
especially helps when debugging with `in_nograb 1` and should also help
if someone wants to integrate an additional GUI toolkit like Dear ImGui.
2022-01-10 00:46:32 +01:00
Daniel Gibson
dc42bdc873 Do gamma correction (r_gamma, r_brightness) in shaders
by injecting code to do it into fragment shaders.

Can be disabled with r_gammaInShaders 0

refs #385
2021-06-20 03:36:39 +02:00
Daniel Gibson
c212148d41 Remove R_LockSurfaceScene(), clean up temporary changes
R_LockSurfaceScene() isn't used anymore, surface locking is implemented
differently (so it actually works now :-p)
2021-06-15 03:27:52 +02:00
Daniel Gibson
1a6998781b Make r_locksurfaces kinda work
refs #357
2021-06-15 03:26:44 +02:00
Daniel Gibson
9a83b3def4 Add r_fullscreenDesktop CVar for "desktop"/windowed fullscreen mode
.. that doesn't switch the display resolution, but creates a borderless
fullscreen window at current desktop resolution.
SDL2-only (SDL_WINDOW_FULLSCREEN_DESKTOP).

Doing this with an additional CVar instead of r_fullscreen 2 or similar
has the advantage that it works properly with Alt-Enter
2021-01-15 18:24:48 +01:00
Daniel Gibson
31e26856e0 (Hopefully) fix Editors messing up game viewport for good, fix #300
I worked around the issue for the particle editor, but now it turned out
it can also somehow happen when switching from the Radiant to the Engine
(with F2), so I implemented the "proper" fix of restoring
glConfig.vidWidth/Height, that are overwritten in
RenderSystemLocal::BeginFrame(), in RenderSystemLocal::EndFrame().
2020-07-20 05:01:51 +02:00
dhewg
b8765ccf22 Move GrabInput() and rename to GLimp_GrabInput()
SDL2 supports multiple windows, and the grabbing is set per
window, so move it to sys/glimp.cpp.
2012-07-20 17:34:34 +02:00
dhewg
227fac443d Fix description of r_swapInterval
This isn't specific to wgl.
2012-07-20 00:13:07 +02:00
dhewg
7f3fc825ed Get rid of GetCardCaps()
Useless now.
2012-07-20 00:13:04 +02:00
dhewg
f4de0ed8c1 Remove the deprecated arb renderer 2012-07-20 00:13:02 +02:00
dhewg
6aa9b3602e Remove the deprecated nv20 renderer 2012-07-20 00:13:01 +02:00
dhewg
3f67a28abe Remove the deprecated nv10 renderer 2012-07-20 00:13:00 +02:00
dhewg
4b67aae8fe Remove the deprecated r200 renderer 2012-07-20 00:12:59 +02:00
dhewg
a18650b27e Remove initial R_SetColorMappings() call
This happens before the SDL GL window is set up, which just
results in a warning. Another call will properly set the
gamma table after the window is initialized.
Make gammaTable a stack variable. This is sufficient, since SDL
already restores the gamma values for us on exit.
2012-01-19 00:53:13 +01:00
dhewg
8ae3ab7641 Get rid of unhooked draw_exp.cpp
Unused experimental Windows-only renderer.
2012-01-05 00:21:43 +01:00
dhewg
13bf514a8f Get rid of Cg leftovers 2012-01-05 00:21:42 +01:00
dhewg
32530bf7a2 Get rid of GLimp_EnableLogging
Only stubs left.
2012-01-02 15:44:00 -05:00
dhewg
3be7fae15c Always link the Windows binaries against OpenGL
Just as with every other platform.
2012-01-02 15:43:59 -05:00
dhewg
1afe61cc8d Get rid of dead render thread code
The Windows backend had some preparing code for this feature,
but there is no support at all for this in renderer/.
2012-01-02 15:43:48 -05:00
dhewg
736ec20d4d Untangle the epic precompiled.h mess
Don't include the lazy precompiled.h everywhere, only what's
required for the compilation unit.
platform.h needs to be included instead to provide all essential
defines and types.
All includes use the relative path to the neo or the game
specific root.
Move all idlib related includes from idlib/Lib.h to precompiled.h.
precompiled.h still exists for the MFC stuff in tools/.
Add some missing header guards.
2011-12-19 23:21:47 +01:00
dhewg
9d97eefb1a Fix -Wwrite-strings warnings
deprecated conversion from string constant to ‘char*’

Constify lots of "char *".
2011-12-10 15:36:00 +01:00
dhewg
79ad905e05 Fix all whitespace errors
Excluding 3rd party files.
2011-12-10 15:35:54 +01:00
dhewg
ff493f6847 Fix quoting in GPL headers 2011-12-10 15:34:48 +01:00
Timothee 'TTimo' Besset
fb1609f554 hello world 2011-11-22 15:28:15 -06:00