Commit Graph

49 Commits (d4634526fdf1121f0d5c37eaa31e965936808cb2)

Author SHA1 Message Date
Günther Brammer d4634526fd GL: Switch from GLEW to Epoxy
Epoxy automatically fetches the extension functions on demand, including
the GLX context creation functions. This means that you can't test the
function pointers for NULL anymore, because they're always set to a
resolver function until the first call. Instead, you have to check for the
availability of an extension by the extension's name. Thanks to Isilkor for
catching these.

On windows, epoxy invalidates all extension function pointers when the
GL context changes. This means we need to have an active context at all
times we call an extension function (like wglGetPixelFormatAttribivARB)
or else the code will jump to an invalid pointer. On the other hand, we do
not need to make it reinitialize the pointers ourselves.

Epoxy automatically uses an alias for a function if the requested name is
not available, like glDebugMessageCallbackARB instead of
glDebugMessageCallback. It also does not have the problem with varying
parameter types for that function. So switch to it while removing
GLDEBUGPROCARB_USERPARAM_IS_CONST.
2016-02-06 16:50:47 +01:00
Günther Brammer 59e5a327b2 gtk: Add support for microsoft windows 2016-02-06 16:47:44 +01:00
Günther Brammer 70d25b0b91 gtk: Fold contents of C4AppGTKImpl.h into C4AppGTK.cpp
C4WindowGTK.cpp no longer needs anything from it.
2016-02-03 03:17:16 +01:00
Nicolas Hake e9cf0f6fdc Stop pretending we support 16 bit color
The GTK and OS X platforms already ignored the requested bit depth and
always used 32 bit. Windows and SDL would set a 16 bit color depth for
the screen, but still did all of the rendering short of the final
present in 32 bit.
2016-02-02 00:00:23 +01:00
Günther Brammer 9210c65e85 gtk: Hide usages of X11 behind #ifdef GDK_WINDOWING_X11 2016-01-23 22:02:51 +01:00
Günther Brammer aa931ac623 Drop some dead code in C4App.h and C4WindowGTK.cpp 2016-01-23 20:36:34 +01:00
Günther Brammer 1c15b8f661 gtk: Move OpenURL to the other implementations in PlatfromAbstraction 2016-01-23 20:36:34 +01:00
Günther Brammer 8f48f0275d gtk: Remove unnecessary C4Window::wnd
It was only used to specify a screen for randr, which doesn't need a
particular window.
2016-01-23 20:36:34 +01:00
Günther Brammer 93f12150c4 CMake: Remove obsolete USE_X11 option and add USE_WIN32_WINDOWS
USE_WIN32_WINDOWS was previously defined in PlatformAbstraction.h. Move it
to CMakeLists.txt and config.h like its peers. Replace USE_X11 with USE_GTK
or GDK_WINDOWING_X11 as appropriate.
2016-01-23 20:36:34 +01:00
Günther Brammer ab7f4f0bbf gtk editor: Use GTK+ 3 layout widgets
Specifically, GtkGrid. For most cases, this is an increase in lines of
code, but the landscape tools dialog can now be done with just three layout
widgets.

While at it, use a toolbar and move the mode buttons into it, too.
2016-01-10 00:19:07 +01:00
Armin Burgmeier eb83fc96d0 linux: fix scrollwheel in fullscreen (#1535)
Both "normal" and "smooth" scroll events were handled, and undoing the
effects of one another.
2016-01-08 20:55:07 -08:00
Armin Burgmeier ef4ea2d931 Drop support for GTK+ 2
The minimum GTK version is now GTK+ 3.4, which is available since 2012.
It's part of Ubuntu LTS 12.04, and so should be available on any halfway
modern linux distribution.

This should allow getting rid of using deprecated GTK+ API much easier.
2015-10-18 14:45:52 -04:00
Julius Michaelis d57a8fd62c Fix two small memleaks 2015-09-24 14:35:50 +02:00
Nicolas Hake 79b702ac4b GLX: Don't crash when multisampling is supported
std::copy'ing into an empty vector doesn't work, and wasn't what was
intended in the first place. Assigning the full range should work better.
2015-06-15 07:03:49 +02:00
Nicolas Hake 36d348d94d GLX: Allow creating debug contexts
To create debug contexts, we have to use glXCreateContextAttribsARB. To use
that, we have to initialize GLEW, which means creating a dummy GL context. To
create a dummy context with the same FB config as the final one, we need to...
initialize GLEW, because it suppresses the GLX 1.4 function declarations.
So instead we'll just manually initialize the three function pointers we're
going to need.
2015-05-28 21:34:11 +02:00
Günther Brammer 5bcedb5bbf Remove some redundant #includes 2015-01-25 18:53:48 +01:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Martin Plicht 60bafd6b3b Change remaining #ifdef USE_GL blocks into #ifndef USE_CONSOLE blocks (this makes Linux version work again) 2013-11-09 00:20:14 +01:00
Oliver Schneider 582e75d3da Use scancodes instead of localized key (#729)
The options dialog still shows localized keys, but the config files use US-Layout keys (when loading default files) and scancodes when saving player changes.
2013-02-09 01:05:27 +01:00
Günther Brammer 414cb8a4c7 gtk: GDK_KEY_* constants require at least GTK+ 2.21.8 2013-01-20 18:41:07 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer 4dffefe8c9 X11: Remove support for the xf86vidmode extension
In practice, only the xrandr code path received any testing. Since Clonk
works fine without changing the resolution, this will not terribly
inconvenience anybody still stuck on old systems without xrandr.

Also only minimize the window when the resolution was changed.
The minimization is there to prevent accidental focus restoration
resulting in unwanted resolution switching.
2012-11-17 18:07:37 +01:00
Julius Michaelis c4506a2b69 Fix entering fullscreen mode in lobby
Remove a debuglog
2012-10-14 17:45:01 +02:00
Armin Burgmeier 26e7ae3532 Fix crash when changing AA setting on Linux (#744) 2012-10-13 14:15:09 +02:00
Armin Burgmeier 2ce648e5b5 Fix a GTK warning when changing anti-aliasing 2012-10-13 12:49:53 +02:00
Julius Michaelis 023aa90c0e Add config option for automatic windowed/fullscreen switching 2012-09-29 23:49:30 +02:00
Günther Brammer f6db61750e Store the size of the non-fullscreen-window separately
The size of that window can be adjusted by the player, so there is no need
for a GUI option.
2012-08-30 00:13:14 +02:00
Günther Brammer cc25878ba6 Default to not changing the resolution
1. We receive bugreports that changing the resolution doesn't work, but
can't reproduce that
2. Flat screens look best at their natural resolution
2012-08-19 20:59:01 +02:00
Günther Brammer 1a29f8625d Reorder engine source file organization a bit
This mostly consists of flattening the hierarchy, splitting the
graphics stuff out of platform, and a few smaller cleanups.
2012-04-27 19:04:43 +02:00
Armin Burgmeier 206f90adbc Pass through key state handling from event callbacks (#745)
This gets rid of Application.IsAltDown() and friends which was used for
this purpose in C4MouseControl and C4EditCursor. In case non-event
callbacks need to access the state of the modifier keys the state is
now cached in these classes (if it wasn't already).

This new solution is supposed to be more robust, since the key modifier
state comes always directly from the input event. This fixes #745, where
Application.IsAltDown was stuck for some reason.

I updated the Windows and Mac code as well, but wasn't able to test it,
it might not compile and/or not work, in which case please someone fix it :)
2012-04-22 22:09:06 +02:00
Günther Brammer 075bc3b866 gtk: fix build with glib older than 2.30 2012-04-20 21:09:17 +02:00
Günther Brammer 7632c823fe gtk: Drop compatibility with GTK versions older than 2.18 2012-04-18 00:37:31 +02:00
Günther Brammer f0c545d773 gtk: Fix build with GTK versions older than 3.4 2012-04-18 00:31:48 +02:00
Günther Brammer 3596daad22 gtk: Make mousewheel scroll again 2012-04-17 22:45:11 +02:00
Nicolas Hake 368692b7d8 GTK: Build fix 2012-04-15 13:32:13 +02:00
Günther Brammer e125003aa9 gtk: Deactivate the resize grip on the OpenGL-drawn windows 2012-04-15 01:17:50 +02:00
Günther Brammer ca7c284c85 gtk: Rename C4AppX to C4AppGTK 2012-03-05 00:38:23 +01:00
Günther Brammer 15ebf70ab1 win32: Move C4GUI::DialogWindow platform code to C4WindowWin32.cpp 2012-04-01 22:16:59 +02:00
Günther Brammer 52e0b52ba9 gtk: Remove some obsolete X11 code 2012-04-10 23:39:16 +02:00
Günther Brammer 05cc1490ea gtk: Reimplement C4Window's GetSize, SetSize, SetTitle 2012-04-04 21:05:48 +02:00
Günther Brammer 0a6c9df7f3 gtk: Move the FindInfo functions to C4WindowGtk.cpp 2012-04-01 22:30:55 +02:00
Günther Brammer c102fe19d8 gtk: Use gtk functions to make a window fullscreen 2012-04-10 03:36:09 +02:00
Günther Brammer c865021716 gtk: Fold C4GtkWindow into C4Window 2012-04-11 04:15:33 +02:00
Günther Brammer dc41afded5 gtk: Replace some X11 input event handling
This regresses because IMs aren't used anymore. GTK+ has its own
IM implementations we should use instead, but for now event->string
is simpler.
2012-04-09 01:10:21 +02:00
Günther Brammer 5f93869978 gtk: Replace C4FullScreen.cpp X11 code with gtk in C4WindowGTK.cpp 2012-04-10 01:56:20 +02:00
Günther Brammer feb13288fa gtk: Replace C4GUI::DialogWindow XLib with gtk calls 2012-04-04 03:42:33 +02:00
Günther Brammer 85a75577e3 gtk: Move some C4ViewportWindow gtk code to C4WindowGTK.cpp 2012-04-09 01:15:30 +02:00
Günther Brammer 5f2f995852 Unify the #include blocks a little bit
One line for C4Include.h, one for the .h corresponding to the .cpp, one
empty line, the other C4* includes, another empty line, external headers.
2011-11-01 23:17:41 +01:00
Günther Brammer 1cafba4be8 Rename files implementing C4AbstractApp and C4Window 2011-10-03 17:19:24 +02:00