Commit graph

521 commits

Author SHA1 Message Date
Fraser Waters 8ed1e20a7a Generate legacy overloads for GetProgramResourceiv 2017-10-05 15:29:56 +01:00
Fraser Waters bf6d047b0c Generate legacy overloads for GetProgramResourceName 2017-10-05 15:27:42 +01:00
Fraser Waters 368c984288 Generate legacy overloads for GetProgramBinary 2017-10-05 15:20:24 +01:00
Fraser Waters c2bd45f676 Generate legacy overloads for GetTranslatedShaderSource 2017-10-05 15:17:59 +01:00
Fraser Waters 168462b4ca Generate legacy overloads for QCOM_extended_get 2017-10-05 15:15:03 +01:00
Fraser Waters 7644d0c94a Generate legacy overloads for GetProgramPipelineInfoLog 2017-10-05 15:12:34 +01:00
Fraser Waters 1485a6b322 Remove unused GetPointerv overloads 2017-10-05 14:53:30 +01:00
Fraser Waters 7c85f82074 Generate legacy overloads for VertexAttrib1fv 2017-10-05 13:42:39 +01:00
Fraser Waters e222486004 Generate legacy overloads for GetObjectPtrLabel 2017-10-05 13:42:39 +01:00
Fraser Waters d9918639fb Generate legacy overloads for GetObjectLabel 2017-10-05 13:42:38 +01:00
Fraser Waters bb456e47a8 Generate legacy overloads for EdgeFlagv 2017-10-05 12:54:04 +01:00
Fraser Waters ffa26fb204 Add feature to Bind to generate legacy array overloads 2017-10-05 12:37:23 +01:00
Fraser Waters 6bd1f0e603 Remove ShaderSource override that had no effect 2017-10-04 22:26:49 +01:00
Fraser Waters 74822fb42f Removing some dead code in Bind
This change doesn't effect the output of Bind.
2017-10-04 20:02:22 +01:00
Fraser Waters 201849b888 Remove trailing whitespace from overrides.xml 2017-10-04 14:32:46 +01:00
Fraser Waters cd0e300785 Merge pull request #641 from Frassle/vector
Add Distance[Squared] methods to Vector(2/3)[d]
2017-10-03 12:16:59 +01:00
Jarl Gullberg 9768febfab
Rename GraphicsContextFlags to ContextFlags and remove the setter. 2017-10-01 20:35:04 +02:00
Jarl Gullberg 881b7553d9
Enable error checking for debug contexts. 2017-10-01 20:16:45 +02:00
Jarl Gullberg c8ca1f33df
Remove obsolete and redundant double buffering assignment. 2017-10-01 20:15:26 +02:00
Jarl Gullberg cbae16b7a1
Correct formatting. 2017-10-01 20:14:53 +02:00
Jarl Gullberg 2caeaf40e1
Correct field naming. 2017-10-01 20:14:39 +02:00
Jarl Gullberg 6e40aebeb3
Remove GTK2 code.
GLArea is only properly supported for GTK >= 3.16.
2017-10-01 20:14:15 +02:00
Jarl Gullberg d3f5a87809
Override context creation in GLArea.
This allows forward compatible and debug contexts to be created, and
provides more descriptive exceptions in the case where the context
cannot be created with the requested settings.
2017-10-01 20:11:58 +02:00
Jarl Gullberg b1f90c380e
Add builtin frame time measurement.
GLArea automatically synchronizes to GDK's refresh rate, which may lead
to incorrect frame time measurements if it's not correctly measured.

This property is guaranteed to always contain the actual live frame
delta of the previous frame in render functions.
2017-10-01 20:06:50 +02:00
Jarl Gullberg 1f33a6dd84
Use Wgl::GetAddress instead of Wgl::GetProcAddress in Utilities. 2017-09-20 16:52:45 +02:00
Fraser Waters 4f9e057358 Add Distance[Squared] methods to Vector3[d] 2017-09-17 14:37:51 +01:00
Fraser Waters 9d596f674b Add Distance[Squared] methods to Vector2[d] 2017-09-17 14:37:51 +01:00
Fraser Waters 211fceddf7 Remove erroneous comment slashes 2017-09-17 14:34:20 +01:00
Jarl Gullberg 29863f13da
Removed redundant WindowInfo initializer. 2017-09-16 16:20:00 +02:00
Jarl Gullberg 82f0d4a5fd
Add InternalsVisibleTo override in build script. 2017-09-15 18:14:32 +02:00
Jarl Gullberg 67a9669917
Bump language version to 7.0. 2017-09-15 16:57:46 +02:00
Jarl Gullberg e6e2764c55
Add explanatory comment. 2017-09-15 12:57:28 +02:00
Jarl Gullberg 4089de86a5
Remove redundant MakeCurrent call. 2017-09-15 12:44:47 +02:00
Jarl Gullberg eb317df44c
Use GLArea MakeCurrent method in disposal as well. 2017-09-15 12:42:57 +02:00
Jarl Gullberg ed126403b3
Use GLArea MakeCurrent method. 2017-09-15 12:42:28 +02:00
Jarl Gullberg 9dd03dd769
Remove redundant SwapBuffers call, the base OnDrawn already does this. 2017-09-15 12:41:36 +02:00
Jarl Gullberg 6d4bb30596
Remove redundant MakeCurrent call, the base OnDrawn already does this. 2017-09-15 12:41:23 +02:00
Jarl Gullberg e9f27ff630
Remove duplicate RenderFrame event (GLArea has one already). 2017-09-15 12:40:21 +02:00
Jarl Gullberg 6a40207b9f
Remove properties that are no longer relevant or used. 2017-09-15 12:39:47 +02:00
Jarl Gullberg 649cce05f7
Remove manual visual selection from the X11 initialization. 2017-09-15 12:38:49 +02:00
Jarl Gullberg e879b73145
Add buffer flag selection. 2017-09-15 12:37:28 +02:00
Jarl Gullberg c485327da5
Remove GLVersion properties, and use the underlying GLArea implementation. 2017-09-15 11:52:50 +02:00
Jarl Gullberg 456d7cde37
Initialize an OpenTK::GraphicsContext from the foreign GDK context. 2017-09-15 11:51:11 +02:00
Jarl Gullberg d677aef6c3
Inherit from GLArea instead of DrawingArea. 2017-09-15 11:21:22 +02:00
Jarl Gullberg d4112a6e95
Add OpenTK.GLWidget as a friend assembly, allowing it to access internals. 2017-09-15 11:21:10 +02:00
varon 077d7c7098 Merge pull request #634 from Frassle/utf8
Change BindingBase to use UTF8, not ASCII, strings
2017-09-03 11:29:55 +02:00
varon f3044c259a Merge pull request #627 from Nihlus/rewrite-new-1-better-options
Simplify option parsing for Generator.Rewrite
2017-09-03 11:28:09 +02:00
varon d9f8120f0d Merge pull request #645 from winterhell/develop
Prevent crash when XInput is not present
2017-09-03 01:19:27 +02:00
varon 11c24a80d9 Merge pull request #644 from Frassle/rewriteexception
Add BindingsNotRewrittenException
2017-09-02 10:18:26 +02:00
Rosen Iliev 33ed6727bf Update XInputJoystick.cs
Debug message for programmers
2017-08-31 10:47:56 +03:00
Rosen Iliev 8e5faec07c Prevent crash when XInput is not present
Now returns from the function instead of throwing an exception
2017-08-30 18:10:56 +03:00
Fraser Waters 6cbaeee54a Replace manually written code using NotImplementedException with BindingsNotRewrittenException 2017-08-28 17:14:21 +01:00
Fraser Waters 7ae39813f3 Rerun Bind.exe 2017-08-28 17:10:06 +01:00
Fraser Waters 741a4cfaac Change binding generator to emit BindingsNotRewrittenException rather than NotImplementedException 2017-08-28 17:09:43 +01:00
Fraser Waters 51a7f0abdb Add BindingsNotRewrittenException 2017-08-28 17:09:18 +01:00
Jarl Gullberg 947162ce6c
Correct altered logic. 2017-08-28 17:01:05 +02:00
Jarl Gullberg 6eb77be281
Correct odd line breaks and remove duplicate debug option. 2017-08-28 16:58:44 +02:00
Jarl Gullberg d7a6c0f3bd
Use 'a' instead of 'i' for the short assembly option. 2017-08-28 16:57:49 +02:00
Fraser Waters 4a31379f92 Add remarks about not reusing the same variable to ref/out methods 2017-08-28 15:52:04 +01:00
Fraser Waters b1e30393a1 Optimize assignment to vector math out parameters
See #500 for more details.

Instead of using the pattern:
        result = new Vector(x, y, z)
Which would allocate and copy a vector instance, instead assign the fields
directly:
        result.X = x;
        result.Y = y;
        result.Z = z;
This should be a small improvment in performance.
2017-08-27 16:13:32 +01:00
Fraser Waters a498da9448 Fix mscorlib 4.0.0.0 reference added by Rewrite.exe 2017-08-26 22:17:04 +01:00
Fraser Waters fd4871aa87 Fix style errors in iPhoneOS project 2017-08-26 13:43:22 +01:00
Fraser Waters ee7f578253 Merge pull request #637 from VPeruS/macos-refresh-rate
Fix DisplayDevice.RefreshRate being 0 for some monitors on MacOS.

Use CoreVideo CVDisplayLink to get correct display refresh rate. Previous implementation can sometimes return 0 according to https://developer.apple.com/documentation/coregraphics/1454661-cgdisplaymodegetrefreshrate.
2017-08-26 12:49:52 +01:00
Fraser Waters ef9d07fcb5 Revert GLWidget back to 4.5 framework due to gtk3 dependency 2017-08-22 13:04:36 +01:00
Fraser Waters 1106a9ab07 Revert GLControl and GLWidget to target 2.0 framework 2017-08-22 11:54:02 +01:00
Jarl Gullberg 975dfc32c7
Correct target command line arguments. 2017-08-19 18:26:34 +02:00
Jarl Gullberg c0060bc681
Update options to the new v2 API. 2017-08-19 18:26:33 +02:00
Jarl Gullberg 3919e5f14f
Updated calls to Rewrite in the OpenTK project. 2017-08-19 18:26:33 +02:00
Jarl Gullberg 4184e6a10e
Inverted unclear check and changed it check the dllimport option directly. 2017-08-19 18:26:33 +02:00
Jarl Gullberg 77ebecb9f7
Removed passing of options and replaced checks with option object access. 2017-08-19 18:26:33 +02:00
Jarl Gullberg fec6c18702
Added some early argument verification. 2017-08-19 18:26:33 +02:00
Jarl Gullberg 20399f2da7
Added option parsing to the main program. 2017-08-19 18:26:33 +02:00
Jarl Gullberg 3cb9c5f833
Added help option and moved required argument to the top. 2017-08-19 18:26:33 +02:00
Jarl Gullberg 7d031a81af
Added option class. 2017-08-19 18:26:33 +02:00
Jarl Gullberg e2098e15e5
Add CommandLineParser to Generator.Rewrite. 2017-08-19 18:26:32 +02:00
VperuS 404c0c3b4b Fix RefreshRate return 0 on MacOS 2017-08-17 08:32:22 +03:00
Jarl Gullberg df9cd1d2f1 Merge pull request #623 from Nihlus/enable-xml-doc-output
Enable XML documentation output for supporting projects
2017-08-14 19:11:07 +02:00
Fraser Waters 440502746a Change BindingBase to use UTF8, not ASCII, strings
From the OpenGL 4.6 core specification, section 22.2:
        String queries return pointers to UTF-8 encoded,
        null-terminated static strings describing properties of the
        current GL context.

From the GLSL 4.6 specification, section 3.1:
        The source character set used for the OpenGL shading languages
        is Unicode in the UTF-8 encoding scheme.

It used to be that strings were ASCII, but ASCII is a safe subset of
UTF8 so any existing code that assumed strings were encoded as ASCII
will continue to work.
2017-08-13 17:44:26 +01:00
Fraser Waters e9e471f785 Fix out String parameters 2017-08-13 14:38:53 +01:00
Fraser Waters 8914faa216 Remove unused variables in Rewrite 2017-08-13 14:35:04 +01:00
Fraser Waters b4dc24cfcf Merge pull request #632 from UnknownShadow200/develop
X11DisplayDevice - Use XRRSizes array directly if dev.Bounds is empty
2017-08-08 17:53:41 +01:00
UnknownShadow200 9a299788d8 Missed one replacement of current_resolution_index to current_sizes_index 2017-08-08 10:03:38 +10:00
Fraser Waters d7c44693e7 Fix SA1000 in Platform\iPhoneOS\iPhoneOSGameView.cs
Fixes "The keyword 'typeof' must not be followed by a space."
2017-08-07 18:01:52 +01:00
UnknownShadow200 84dc4d207c X11DisplayDevice - Use XRRSizes array directly if dev.Bounds is empty
Directly indexing into the array returned from XRRSizes is the way khronos recommends at https://www.khronos.org/opengl/wiki/Programming_OpenGL_in_Linux:_Changing_the_Screen_Resolution

The old way was multiplying that index by depths.Length, as an index into the available_res list. This is incorrect because it doesn't account for when a display device has multiple refresh rates.
2017-08-08 00:13:23 +10:00
Fraser Waters 178508ac0e Merge pull request #625 from Frassle/opengl4.6
Add OpenGL 4.6 Support
2017-08-06 18:39:21 +01:00
Fraser Waters e331a6d5ca Merge pull request #624 from Nihlus/cocoa-machport-leak-fix
Fix leaking Cocoa Machports on macOS
2017-08-06 18:11:09 +01:00
Fraser Waters 2e88a735dc Fix casting bug introduced in 127c6fd6
A "&" operator was accidently removed when updating variables to
auto-properties.
2017-08-06 18:06:40 +01:00
UnknownShadow200 5f158997b8 Use Marshal.SystemDefaultCharSize instead of hardcoding 2 bytes per char
Also move Marshal.FreeHGlobal up because buffer doesn't need to persist after PtrToStringAuto was called.
2017-08-06 08:36:51 +10:00
UnknownShadow200 a3c0b05371 Allocate 2 instead of 1 byte per char for buffer used in WinGLNative.HandleDropFiles
DragQueryFile returns number of characters. Previously, a buffer of 'number of characters' bytes was being allocated.

This change fixes crashing when the platform uses a character set with more than one byte per character. (unicode charset has 2 bytes)

Fixes #626
2017-08-05 23:56:42 +10:00
Jarl Gullberg 9893283fc6
Correct documentation output directory. 2017-08-04 18:47:47 +02:00
Jarl Gullberg 77bca92a02
Use local variable instead of reusing the field. 2017-08-04 18:46:17 +02:00
Jarl Gullberg b0e7465f6c
Reuse selectors. 2017-08-04 18:40:16 +02:00
Jarl Gullberg c02e959f7a
Move early return out of the autorelease pool. 2017-08-04 18:39:44 +02:00
Fraser Waters b9e03c99b3 Rerun Generator.Bind 2017-08-04 16:57:38 +01:00
Fraser Waters a29e342508 Add two new types to Generator.Bind
GLeglClientBufferEXT, and GLVULKANPROCNV. Both are mapped to IntPtrs.
2017-08-04 16:57:38 +01:00
Fraser Waters 7e5b937bc5 Regenerate signatures.xml from OpenGL-Registry
Generated from commit c21e602b9fda1d3bbaecb08194592f67e6a0649b
https://github.com/KhronosGroup/OpenGL-Registry/raw/master/xml/gl.xml
2017-08-04 16:57:38 +01:00
Jarl Gullberg af1e3bdf0f
Correct screwy formatting. 2017-08-04 17:41:45 +02:00
Jarl Gullberg 3cf07ff790
Broke the autorelease code out into a class and replaced the usage. 2017-08-04 17:38:26 +02:00
Jarl Gullberg a7ddb543a9
Moved the autorelease pool to the context. 2017-08-04 17:38:26 +02:00
Jarl Gullberg 5828203f8e
Implemented an autorelease pool for Cocoa's NativeWindow implementation. 2017-08-04 17:38:26 +02:00