Commit graph

336 commits

Author SHA1 Message Date
Christoph Oelckers
e132fc5eed - replaced GLEW with GLLoadGen for GL access. This allows to have a header that only contains what's actually required, namely OpenGL 3.3 plus glBegin and glEnd which are the only compatibility functions needed for the fallback render path.
GLEW has two major problems:

- it always includes everything, there is no way to restrict the header to a specific GL version
- it is mostly broken with a core profile and only works if all sanity checks get switched off.
2014-08-21 11:02:46 +02:00
Christoph Oelckers
86d37e06f9 - lowered requirements of GL 2.x to OpenGL 3.3.
There was one issue preventing the previous 2.0 betas from running under GL 3.x: The lack of persistently mapped buffers.
For the dynamic light buffer today's changes take care of that problem.
For the vertex buffer there is no good workaround but we can use immediate mode render calls instead which have been reinstated.

To handle the current setup, the engine first tries to get a core profile context and checks for presence of GL 4.4 or the GL_ARB_buffer_storage extension.
If this fails the context is deleted again and a compatibility context retrieved which is then used for 'old style' rendering which does work on older GL versions.

This new version does not support GL 3.2 or lower, meaning that Intel GMA 3000 or lower is not supported. The reason for this is that the engine uses a few GL 3.3 features which are not present in the latest Intel driver.
In general the Intel GMA 3000 is far too weak, though, to run the demanding shader of GZDoom 2.x, so this is no real loss. Performance would be far from satisfying.

A command line option '-gl3' exists to force the fallback render path. On my Geforce 550Ti there's approx. 10% performance loss on this path.
2014-08-19 15:56:33 +02:00
Christoph Oelckers
a8e9c1832f - decided to restrict the 2.0 beta to OpenGL 4.x with GL_ARB_buffer_storage extension and removed all code for supporting older versions.
Sadly, anything else makes no sense.
All the recently made changes live or die, depending on this extension's presence.
Without it, there are major performance issues with the buffer uploads. All of the traditional buffer upload methods are without exception horrendously slow, especially in the context of a Doom engine where frequent small updates are required.
It could be solved with a complete restructuring of the engine, of course, but that's hardly worth the effort, considering it's only for legacy hardware whose market share will inevitably shrink considerably over the next years.
And even then, under the best circumstances I'd still get the same performance as the old immediate mode renderer in GZDoom 1.x and still couldn't implement the additions I'd like to make.

So, since I need to keep GZDoom 1.x around anyway for older GL 2.x hardware, it may as well serve for 3.x hardware, too. It's certainly less work than constantly trying to find workarounds for the older hardware's limitations that cost more time than working on future-proofing the engine.

This new, trimmed down 4.x renderer runs on a core profile configuration and uses persistently mapped buffers for nearly everything that is getting transferred to the GPU. (The global uniforms are still being used as such but they'll be phased out after the first beta release.
2014-08-01 22:42:39 +02:00
Christoph Oelckers
ef8f66c9a1 - removed the code for hardware alpha testing again because it didn't work anymore with how things are set up now.
- we need to check all GL versions when trying to get a context because some drivers only give us the version we request, leaving out newer features that are not exposed via extension.
- added some status info about uniform blocks.
2014-07-30 23:13:16 +02:00
Christoph Oelckers
f64428dd2a Merge branch 'master' into Glew_Version_For_Real 2014-07-17 09:31:18 +02:00
Christoph Oelckers
b78b566b0a Merge branch 'master' of https://github.com/rheit/zdoom 2014-07-17 09:30:50 +02:00
Christoph Oelckers
eb9d2d9917 - reactivate compatibility profile so that immediate mode drawing can be used on older hardware not supporting persistently mapped buffers.
- reactivate alpha testing per fixed function pipeline
- use the 'modern' way to define clip planes (GL_CLIP_DISTANCE). This is far more portable than the old glClipPlane method and a lot more robust than checking this in the fragment shader.
2014-07-17 02:37:18 +02:00
Braden Obrzut
b6bbdf6195 - Call C_DeinitConsole in I_Quit so that we can be sure that Printf will work for as long as possible. Otherwise ZDoom will crash when ending a demo recording. 2014-07-16 18:59:49 -04:00
Christoph Oelckers
fc0cf4f998 - GZDoom now runs on an OpenGL core profile. :)
It's probably still necessary to replace GLEW with another loader library. GLEW is pretty much broken on core OpenGL without some hacky workarounds...
2014-07-15 02:26:23 +02:00
Christoph Oelckers
84a49e37ee - handle normals for spheremapped mirror surfaces using non-deprecated features.
- move all WGL references out of global header files so that global wgl header include is no longer necessary
2014-07-14 19:54:07 +02:00
Christoph Oelckers
e15f80f640 Merge branch 'master' of https://github.com/rheit/zdoom 2014-06-23 09:27:30 +02:00
Shawn Walker
6164807e97 - fix x64 visual studio linking for common controls 2014-06-21 22:49:42 -07:00
Christoph Oelckers
4e64ad847b Merge branch 'master' of https://github.com/rheit/zdoom 2014-05-15 09:46:47 +02:00
Christoph Oelckers
24886b6734 - removed the last static character arrays from FLevelLocals. 2014-05-13 23:16:13 +02:00
Christoph Oelckers
a05e62f3f7 - changed storage of lump and texture names in gameinfo to allow long names (with the exception of view border elements.) 2014-05-13 12:44:17 +02:00
Christoph Oelckers
29231fa3b7 Merge branch 'master' of https://github.com/rheit/zdoom 2014-04-16 11:34:32 +02:00
Christoph Oelckers
48b926e5b4 - check +logfile explicitly at the start of execution. Due to the custom CVAR rewrite it would get called so late that it'd miss half of the log.
- added version check for Windows 8. I also would have liked to add 8.1 but due to some incredibly stupid changes in the version API it's no longer possible to reliably retrieve the correct Windows version for later builds.
2014-04-16 09:53:07 +02:00
Christoph Oelckers
dc8f81c2a7 Merge branch 'master' of https://github.com/rheit/zdoom
Conflicts:
	src/sdl/iwadpicker_cocoa.mm
2014-01-18 01:18:21 +01:00
Braden Obrzut
d8ff4ec281 - Fixed: All clang 5.0 warnings.
- Renamed autostart/autozend since Xcode’s build process links in strictly alphabetical order.
2014-01-05 19:50:09 -05:00
Christoph Oelckers
45070114e8 Merge branch 'master' of https://github.com/rheit/zdoom
Conflicts:
	.gitignore
	CMakeLists.txt
2013-11-28 12:44:27 +01:00
Christoph Oelckers
7cb70f60b3 - removed duplicate #define warning in fmodsound.cpp.
- commented out output of Cr0NpxState for floating point state because this variable was renamed in most recent Windows headers.
- added CMAKE option to generate assembly output for release builds.
- added my CMake-based project directory to .gitignore.
2013-11-28 11:03:19 +01:00
Christoph Oelckers
bab56106c1 Merge branch 'master' of https://github.com/rheit/zdoom 2013-08-31 21:53:11 +02:00
Randy Heit
28e5cc536a Add some awareness of short file names
- Added I_GetLongPathName(). It wraps the Win32 API's GetLongPathName().
  DArgs::CollectFiles() now calls this for every argument it processes, so
  any arguments passed using short file names will be converted to long
  file names. This is mainly of interest so that savegames will never
  record the short file name, which can change based on what else is in
  the directory.
2013-08-29 21:24:05 -05:00
Christoph Oelckers
b61ef3a107 - bumped minimum supported OpenGL version to 1.4. The engine was already using several 1.3 and 1.4 features which would have caused problems on 1.2.
- removed gl_vid_compatibility. With the bump to 1.4 no hardware requiring this flag is supported anymore.
- disabled 16 bit framebuffers for the same reason. As a conseqence all code for rendering without stencil could also be removed.
2013-08-18 15:41:52 +02:00
Christoph Oelckers
761ab4ab78 - moved all system specific code out of gl_interface.cpp into the respective Video classes (Win32GLVideo andSDLGLVideo.) (SDL side not tested yet!) 2013-08-18 14:16:33 +02:00
Christoph Oelckers
b59d82ad5b - made win32gliface.cpp more readable. 2013-08-18 12:38:38 +02:00
Christoph Oelckers
399d0974ab - added GL render as of SVN revision 1600. 2013-06-23 09:49:34 +02:00
Randy Heit
98ac224e53 - Use gitinfo.h instead of svnrevision.h for versioning.
- Use functions in gitinfo.cpp to retrieve the strings from gitinfo.h so
  that changes to gitinfo.h only require recompiling one file instead of
  several.
2013-06-22 21:49:51 -05:00
Randy Heit
9510525fdf - Bump up to 2.7.0.
SVN r4339 (trunk)
2013-06-08 02:20:37 +00:00
Randy Heit
be0845acf1 - Moved all BorderNeedRefresh and SB_state updating code into separate functions that won't crash if screen is NULL.
SVN r4167 (trunk)
2013-02-27 03:10:25 +00:00
Randy Heit
11ca707485 - Added vid_maxfps cvar to limit the frame rate to some arbitrary rate between 35 and 1000 FPS. It
defaults to 200. Setting it to 0 will restore the previous behavior of having no frame rate
  limit. Note that vid_maxfps 35 is NOT the same as cl_capfps 1. cl_capfps caps the frame rate
  by tying the video update directly to the game timer. With vid_maxfps 35, the video update and
  game timer are running on separate timers, and results will not be as good as with cl_capfps 1,
  which uses only one timer.

SVN r3872 (trunk)
2012-09-16 04:40:56 +00:00
Randy Heit
ede622bb93 - Change the text when riched20.dll cannot be loaded, and also display it with MessageBox, since
it's far too early to be used with I_FatalError. (But since this should always be available on
  every Windows version after 95, this should be a non-issue.)
- Make unknown OS versions default to Windows 2000 instead of Windows 95.

SVN r3802 (trunk)
2012-08-02 04:00:40 +00:00
Randy Heit
a051697488 - Since ZDoom hasn't actually run on Windows 95 in some time, and nobody has complained, remove the IsDebuggerPresent thunk.
SVN r3800 (trunk)
2012-08-02 03:44:13 +00:00
Randy Heit
a5d77e6796 - Don't use abbreviations in exception descriptions.
SVN r3738 (trunk)
2012-07-06 02:29:00 +00:00
Randy Heit
8673743139 - Do not set the mouse pointer if the display is 8 bit, since such displays don't support color cursors.
SVN r3734 (trunk)
2012-07-05 21:46:03 +00:00
Randy Heit
ca33d55bd3 - Fixed: DDrawFB should not recreate all its resources when the palette changes if we were
the one responsible for the palette change.
- Fixed: DDrawFB::CreateSurfacesComplex() starting tries at 2 instead of 0 is not "debugging cruft"
  since it counts down, not up. (Partially reverts r3195)

SVN r3733 (trunk)
2012-07-05 21:05:06 +00:00
Christoph Oelckers
814ce3d39c - fixed: The D3D FlatFill function ignored the alpha channel, unlike its counterpart in the paletted renderer.
SVN r3702 (trunk)
2012-06-21 08:54:50 +00:00
Randy Heit
c197d0687c - Fixed: FinalGC() needs to run before the type system is shut down.
- Fixed: Don't access class metadata at all in DObject::PropagateMark if the type system is shutdown.
- Fixed: If FCompressedMemFile::Reopen() fails, then it would try to double-free memory when deleted.

SVN r3688 (trunk)
2012-06-16 03:10:38 +00:00
Christoph Oelckers
970d5afcd2 - fixed: The text screen's color #6 should be brown, not dark yellow.
SVN r3687 (trunk)
2012-06-15 07:17:30 +00:00
Randy Heit
9d4ba3c7fd - Unraveled the want_native bit in I_CheckNativeMouse somewhat to ensure that it ends up false
when menuactive == MENU_WaitKey, even if you're not in a level.

SVN r3618 (trunk)
2012-05-04 02:16:19 +00:00
Randy Heit
0d302269bb - Fix GCC errors in fb_d3d9.cpp.
SVN r3492 (trunk)
2012-03-30 04:03:46 +00:00
Randy Heit
510838c3c1 - Undo accidental commit of win32video.cpp with test resolution in place.
SVN r3483 (trunk)
2012-03-25 03:08:13 +00:00
Randy Heit
23e88c88c9 - Add 17:10 aspect ratio, for 1024x600 screens.
SVN r3482 (trunk)
2012-03-25 02:57:28 +00:00
Randy Heit
162ad601ba - Fixed bug introduced in r3412: The SetStyle() call needs to come after the scissoring check,
because the latter can flush the quads, including the one SetStyle() just set a style for.

SVN r3429 (trunk)
2012-03-12 01:22:19 +00:00
Randy Heit
76b5e7ef60 - Fixed: D3DFB::DrawTextureV() did not disable the scissor test if it was needed but SetStyle()
decided there was nothing to draw. In practical terms, this means that if your weapon is
  completely invisible, the game would not draw anything outside of the main play area because
  the scissor test would be left on for the entire frame and not just the weapon's quad.

  Making the call to SetStyle() before the scissor check is enough to fix this.

SVN r3412 (trunk)
2012-03-09 00:12:04 +00:00
Randy Heit
d54f9c3616 - Added startup screen customization, courtesy of Gez.
SVN r3375 (trunk)
2012-02-21 19:52:40 +00:00
Christoph Oelckers
5bfcaab25c - separation of software renderer from the rest of the code complete. All external access to the renderer is routed through the FRenderer interface class now, with two exceptions (2D texture drawing to a canvas and polymost testing code) that are handled by #defines.
SVN r3263 (trunk)
2011-07-07 15:37:47 +00:00
Christoph Oelckers
463c276014 - removed more r_ header dependencies from the rest of the code.
SVN r3260 (trunk)
2011-07-06 15:31:05 +00:00
Christoph Oelckers
fbff5ca932 - moved r_interpolate.cpp and r_translate.cpp to r_data.
- merged r_jpeg.h into jpegtexture.cpp because that's the only place where it's ever used.


SVN r3255 (trunk)
2011-07-06 08:50:15 +00:00
Christoph Oelckers
5c6fd66ed5 - rename src/resources to src/r_data.
SVN r3254 (trunk)
2011-07-06 07:35:36 +00:00