Commit graph

5213 commits

Author SHA1 Message Date
parallels 0bf8565c0f Merge branch 'master' of https://github.com/thefiddler/opentk into modes 2013-11-09 17:17:22 +01:00
parallels dff5e1c3a3 Maintain support for VS2010 and MD2.x 2013-11-09 17:16:00 +01:00
parallels 7f921dae47 Merge branch 'master' of https://github.com/thefiddler/opentk into modes 2013-11-09 17:15:05 +01:00
parallels da684d233e Swallow DllNotFoundException in Sdl2 constructor 2013-11-09 17:13:24 +01:00
Stefanos A. b66912a8e1 Potential fix for issue 3430
EnableCap.ColorArray is part of the client state and must be enabled
with GL.EnableClientState, not GL.Enalbe. This is a potential fix for
http://www.opentk.com/node/3430 "Picking example's problem"
2013-11-09 15:13:50 +01:00
Stefanos A 95316829ec Updated WGL init sequence
WinGraphicsMode no longer creates a temporary context in order to create
the list of available modes. Instead, it requires to be passed an
existing context in its constructor.

WinGLContext now creates one temporary context in its static constructor
and hands that to WinGraphicsMode.

WinFactory no longer supports the CreateGraphicsMode API. This API will
be removed in the future, because the link because contexts and modes
cannot be separated in the general case.
2013-11-09 15:07:19 +01:00
Stefanos A 0f01a6d128 Stronger check for ES support
It is not enough to check for EGL, we also need to check that
ContextProfileFlags.ES is set.
2013-11-09 15:07:18 +01:00
Stefanos A ec2c64ee15 Remove static init of GetCurrentContext
The static initializer of GetCurrentContext would always default to the
desktop PlatformFactory, which caused problems when trying to run OpenGL
ES code on the desktop. The initializer is now removed and
GetCurrentContext is set in the context constructor, before creating any
contexts.
2013-11-09 15:07:17 +01:00
Stefanos A 440e3fe248 Load ES30 and OpenGL4 entry points 2013-11-09 15:07:16 +01:00
Stefanos A 2725b3cd08 Fix support for 3.2+ contexts (issue 3111)
glXGetProcAddress may return a non-null value even if a function is not
supported by the server. We need to check the extension string using
any GLX extensions. Fixes issue http://www.opentk.com/node/3111 "GLX
extension support is not checked correctly".

Furthermore, mode selection is now performed explicitly by the
X11GLContext constructor.
2013-11-09 11:16:14 +01:00
Stefanos A 3c71634667 Temp context not necessary for GLX
GLX entry points are not bound to a specific context. This means that, unlike WGL, GLX does not require a temporary context in order to load its entry points!
2013-11-09 11:07:37 +01:00
Stefanos A 6edaf8c3cf Deduplicate MacOSGraphicsMode and AglContext
The IGraphicsMode interface is gradually being removed and the
MacOSFactory will now throw an exception if an instance is requested.
AglContext no longer duplicates MacOSGraphicsMode functionality.
2013-11-08 18:44:02 +01:00
Stefanos A f77a6b11c3 SDL_GL_GetAttribute requires a valid context
Calling SDL_GL_GetAttribute when context construction has failed leads
to erroneous behavior. This call should only be made when a context has
been constructed correctly.
2013-11-08 17:31:54 +01:00
Stefanos A 5b5a395bbd Merge branch 'master' of https://github.com/thefiddler/opentk into modes 2013-11-08 16:41:20 +01:00
Stefanos A 49df5ff453 Do not generate delegates for overloads
We should only generate delegates for actual OpenGL entry points, not
for overloaded functions that resolve to the same entry point. This
improves loading speeds and reduces the size of the compiled dll.
2013-11-08 16:40:43 +01:00
Stefanos A 5a2fc1e411 Added missing doc comment 2013-11-08 15:33:41 +01:00
Stefanos A e0ffd9b42d More sane Sdl2Factory.CreateGetCurrentContext() implementation 2013-11-08 15:26:52 +01:00
Stefanos A 29fe1052de Added SDL_GL_GetCurrentContext method and TouchMouseID constant.
SDL_GL_GetCurrentContext will allow us to replace the weird
implementation in Sdl2Factory.CreateGetCurrentGraphicsContext()
and the latter to disable mouse emulation if we wish to.
Conflicts:
	Source/OpenTK/Platform/SDL2/Sdl2.cs
2013-11-08 15:25:42 +01:00
Stefanos A eba7e59253 Fixed ES rendering. 2013-11-08 10:56:45 +01:00
Stefanos A 28fa768257 Fixed platform detection for Android
Conflicts:
	Source/OpenTK/Configuration.cs
2013-11-08 10:54:50 +01:00
Stefanos A. a51540e8d9 Updated WGL init sequence
WinGraphicsMode no longer creates a temporary context in order to create
the list of available modes. Instead, it requires to be passed an
existing context in its constructor.

WinGLContext now creates one temporary context in its static constructor
and hands that to WinGraphicsMode.

WinFactory no longer supports the CreateGraphicsMode API. This API will
be removed in the future, because the link because contexts and modes
cannot be separated in the general case.
2013-11-08 10:46:27 +01:00
Stefanos A. c9b905d235 Stronger check for ES support
It is not enough to check for EGL, we also need to check that
ContextProfileFlags.ES is set.
2013-11-08 10:42:48 +01:00
Stefanos A. 2cd91bd0a0 Remove static init of GetCurrentContext
The static initializer of GetCurrentContext would always default to the
desktop PlatformFactory, which caused problems when trying to run OpenGL
ES code on the desktop. The initializer is now removed and
GetCurrentContext is set in the context constructor, before creating any
contexts.
2013-11-08 10:41:58 +01:00
Stefanos A. a12b394607 Load ES30 and OpenGL4 entry points 2013-11-08 10:39:08 +01:00
Stefanos A. 03c04fd308 Workaround for issues #4 and #6
GraphicsMode.Default used to be set to
(DisplayDevice.Default.BitsPerPixel, 16, 0, 0, 0, 2, false) for improved
compatibility with older systems. However, this appears to be causing
issues with specific modern GPUs. Switch the default mode to (32, 24, 8)
until a more proper solution can be found.
2013-11-07 18:42:17 +01:00
Stefanos A. 29d8fc603b Added readme for Dependencies folder 2013-11-07 18:13:39 +01:00
Stefanos A. 000b631200 Added ANGLE Project binaries
The ANGLE Project binaries can be used to test OpenGL ES code on
Windows. Additionally, these provide the only path to run OpenGL code on
the Windows Store.
2013-11-07 18:13:26 +01:00
Stefanos A. 655355b086 Do not ignore Dependencies/x64 directory 2013-11-07 18:12:34 +01:00
Stefanos A. 7d74c37d2a Added usage example for new xml specs 2013-11-07 17:18:12 +01:00
Stefanos A b6610001ea Merged ES 2.0 extension tokens to ES 3.0
By adding ES 2.0 extensions tokens to ES 3.0, we have a very
straightforward update path to move an application from the older API
to the newer.
2013-11-07 16:54:39 +01:00
Stefanos A 7ab5e3ab6c Use paths without apiversion attribute
Paths that don't define a "version" attribute will now match all
possible versions. This will make it easier to add support for newer
APIs as they are introduced.
2013-11-07 16:48:11 +01:00
Stefanos A 1f6d445021 Removed non-existent token from OpenGL
COMPRESSED_ALPHA_BPTC_UNORM does not appear to be defined anywhere.
Removed.
2013-11-07 16:46:38 +01:00
Stefanos A be8f7c6311 Corrected ES 2.0 enums
After the previous commit, several ES 2.0 functions would refer to
enums found in ES 3.0. These enums have been copied to ES 2.0, either
as core enums or as extensions.
2013-11-07 16:25:19 +01:00
Stefanos A 735d05e496 Merged ES2.0 and ES3.0 replacements
ES 3.0 includes ES 2.0 verbatim. We can significantly reduce
duplication by using the same <replace> node for both APIs. Note that
the enumerations must remain separate, as ES 2.0 and 3.0 support
different tokens.
2013-11-07 11:37:51 +01:00
Stefanos A 7c54a19708 ES 3.0 fixed enums for GetIntegeri_v and GetInteger64i_v
These functions have a first parameter named "target", not "pname".
Fixed now.
2013-11-07 10:58:02 +01:00
Stefanos A e59c95f2f9 ES 3.0 fixed enums for GetInteger64*
GetInteger64v should accept GetPName, while GetInteger64i_v should
accept GetIndexedPName.
2013-11-07 10:39:20 +01:00
Stefanos A 8de24c97fb ES 3.0 strong enums for DrawBuffersEXT and NV
Relax the extension constraint in DrawBuffers, in order to add strong
enums to the extension varieties of this function.
2013-11-07 10:33:02 +01:00
Stefanos A 2d1df46d98 ES 3.0 strong enums for DrawArrays*() and Draw*Elements*()
The strongly-typed enums include core and extension varieties.
2013-11-07 10:17:33 +01:00
Stefanos A 0002b2e23e Fixed typo in ES3Generator.cs
The DllImports file should be named ES30Core.cs, not ES3Core.cs. Fixed
now.
2013-11-07 10:09:17 +01:00
Stefanos A 0f98f0e00b Fixed misspelled and missing enums 2013-11-07 09:47:27 +01:00
Stefanos A 93b8d4b86e Fixed enums for (Get)ObjectLabel
ObjectLabel and GetObjectLabel are part of KHR_debug.
2013-11-07 09:34:48 +01:00
Stefanos A 0598e02140 Fixed enums for GetDebugMessageLog
GetDebugMessageLog was misspelled as GetMessageDebugLog. This is now
fixed.
2013-11-07 08:39:57 +01:00
Stefanos A de38df8820 Fixed strong-enums for GetDebugMessageLog
GetDebugMessageLog is part of KHR_debug.
2013-11-07 08:36:23 +01:00
Stefanos A a2f2ab29ea Fixes for ES 3.0 strongly-typed enums
Fixed parameter mismatches in CopyBufferSubData and BlendFuncSeparate.
Implemented KHR_debug extension.
2013-11-07 08:33:17 +01:00
Stefanos A 2f3d79d464 Merge branch 'master' of https://github.com/thefiddler/opentk 2013-11-07 08:15:18 +01:00
Stefanos A 2b4d10ffd7 Strongly-typed enums for ES 3.0 (complete)
Implemented sectiosn: Pixel Rectangles. Binding & Managing Framebuffer
Objects, Renderbuffer Objects, Attaching Renderbuffer Images to
Framebuffer, Attaching Texture Images to Framebuffer, Framebuffer
Completeness, Invaildating Framebuffer Contents, Renderbuffer Object
Queries, Simple Queries, String Queries.
2013-11-07 08:14:49 +01:00
Stefanos A. 62c9793a6e Fixed number of buffers
ContextAttribute.DOUBLEBUFFER is a boolean in SDL (false->single
buffering, true->double buffering). We need to adjust the number of
buffers accordingly (single buffering->1 buffer, double buffering->2
buffers).
2013-11-06 01:04:59 +01:00
Stefanos A 21a1ca8895 Switch to EnumDisplayModesEx
Use EnumDisplayModesEx instead of EnumDisplayModes. This might help
with issue #6.
2013-11-05 23:41:42 +01:00
Stefanos A a4f125f16e Added workaround for issue #6
The issue is that some display devices report a BitsPerPel value of 0.
It is not clear whether this is a bug in WinDisplayDevice.cs or some
strange windows issue. The implemented workaround adds an entry to the
debug log and hardcodes BitsPerPel to 32 whenever this condition is
encountered. More investigation required.
2013-11-05 23:21:49 +01:00
Stefanos A 1a02457ddc Strongly-typed enums for ES 3.0 (WIP8)
Implemented sections: Hints and Sync Object Quries.
Renamed SyncParameter to SyncParameterName, as per the OpenGL naming
conventions.
2013-11-05 10:23:25 +01:00