Commit graph

521 commits

Author SHA1 Message Date
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
Jarl Gullberg 446a484f7f
Correct missing parameter documentation. 2017-08-04 17:34:46 +02:00
Jarl Gullberg aa60aeb86a
Documented Options class in the converter. 2017-08-04 17:34:46 +02:00
Jarl Gullberg 7c85903456
Documented WrapperTypes enum. 2017-08-04 17:34:46 +02:00
Jarl Gullberg 8bd4de42a7
Documented FunctionBody class. 2017-08-04 17:34:46 +02:00
Jarl Gullberg 57ba670952
Add missing documentation, and pull indentation in by one. 2017-08-04 17:34:46 +02:00
Jarl Gullberg 77241fdbb3
Remove documentation for missing parameter. 2017-08-04 17:34:46 +02:00
Jarl Gullberg 337b6d4632
Enable XML documentation output for the supporting tools. 2017-08-04 17:34:46 +02:00
Jarl Gullberg 3bfaeda99d
Correct arithmetic operator position. 2017-08-04 12:35:06 +02:00
Jarl Gullberg c06ce5658d
Correct equality comparsion operator position. 2017-08-04 12:35:06 +02:00
Jarl Gullberg 205cb307ec
Correct base call operator position. 2017-08-04 12:35:06 +02:00
Jarl Gullberg b08acb758a
Correct cast operator position. 2017-08-04 12:35:06 +02:00
Jarl Gullberg 5db88e0a8f
Correct cast operator position. 2017-08-04 12:35:06 +02:00
Jarl Gullberg af3aef4d9e
Remove redundant base constructor call. 2017-08-04 12:35:06 +02:00
Jarl Gullberg 15551b015f
Correct semicolon spacing in XWindowInfoInitializer.cs 2017-08-04 12:04:59 +02:00
Jarl Gullberg 5dcbea8405
Correct semicolon spacing in API.cs 2017-08-04 12:04:46 +02:00
Jarl Gullberg fb0c24a56c
Correct semicolon spacing in Generator.Bind. 2017-08-04 11:41:52 +02:00
Jarl Gullberg 3654fa4107
Correct semicolon spacing in OpenTK. 2017-08-04 11:41:52 +02:00
Jarl Gullberg 8c434a2629
Correct comma spacing in DisplayService. 2017-08-03 11:50:46 +02:00
Jarl Gullberg 9ed5e53a92
Correct comma spacing in GLObsolete. 2017-08-03 11:50:44 +02:00
Jarl Gullberg de030a97a5
Regenerate bindings to correct comma spacing. 2017-08-03 11:50:43 +02:00
Jarl Gullberg 048207425b
Correct method generation to account for SA1001. 2017-08-03 11:50:42 +02:00
Jarl Gullberg cab25daf16
Correct comma spacing in OpenTK, excluding generated files. 2017-08-03 11:50:42 +02:00
Jarl Gullberg e4d8be5658
Correct comma spacing in Generator.Rewrite. 2017-08-03 11:50:42 +02:00
Fraser Waters bc3f33271f Merge pull request #590 from Frassle/gamewindowtests
GameWindow tests and some X11 fixes
2017-08-02 15:04:47 +01:00
Fraser Waters 302ec5001a Merge pull request #597 from ppy/fix-white-flash
Fix white flash when starting GameWindow based application on windows
2017-08-01 13:50:30 +01:00
Dean Herbert cf572b3bb8 Add comment regarding performance 2017-07-31 22:31:02 +09:00
Dean Herbert 4fe58d9545 Add comment about setting background color 2017-07-31 15:52:46 +09:00
Fraser Waters 38e91eb91e Wait for ConfigureNotify when changing X11 Bounds 2017-07-30 22:36:26 +01:00
Fraser Waters 5213ec200e Change client_rectangle to client_size
The Location part of client_rectangle was never used.
2017-07-30 22:36:26 +01:00
Fraser Waters 26fac6f032 Change X11 entry assembly search and provide null fallback 2017-07-30 22:36:26 +01:00
Jarl Gullberg 80262863fd
Move StyleCop properties to global section. 2017-07-30 18:36:12 +02:00
Jarl Gullberg e9422ab25c Merge pull request #608 from Nihlus/cleanup-6-keyword-spacing
Correct keyword spacing
2017-07-30 17:28:04 +02:00
Jarl Gullberg b84f4e21c7 Merge pull request #609 from leezer3/RailDriver
Windows HID: Implement generic Consumer device which returns a button collection
2017-07-28 13:37:42 +02:00
Jarl Gullberg 7090695ac6
Correct keyword spacing in OpenTK. 2017-07-28 12:29:22 +02:00
Jarl Gullberg 1260fd0a6b
Correct keyword spacing in Generator.Bind. 2017-07-28 12:23:33 +02:00
Jarl Gullberg 1931919e2e
Use explicit modifiers for Android code. 2017-07-28 12:08:57 +02:00
Jarl Gullberg 016799060a
Use explicit modifiers for iOS code. 2017-07-28 12:06:13 +02:00
Jarl Gullberg e7620a11b4
Remove regions from iOS and correct brace style. 2017-07-28 12:01:28 +02:00
Jarl Gullberg 15a0d86fe0
Remove regions from Android. 2017-07-28 12:01:12 +02:00
Jarl Gullberg 56bf133a78 Merge pull request #600 from Nihlus/stylecop-1-initial
Add StyleCop.Analyzers to projects
2017-07-28 11:22:32 +02:00
Fraser Waters 62a2db426f Fix Helper methods to use out Strings 2017-07-28 06:16:53 +01:00
Fraser Waters c395841b34 Run Generator.Bind 2017-07-28 06:16:52 +01:00
Fraser Waters d547a81cab Use "out String" parameters instead of "StringBuilder" 2017-07-28 06:16:52 +01:00
Fraser Waters c296ebc0f5 Run Generator.Bind 2017-07-28 06:16:51 +01:00
Fraser Waters 34d7655274 Emit CountAttributes during binding
Adds a new parameter attribute CountAttribute that is emitted during
binding. CountAttribute is based on the "len" attribute in the
specifications. It describes what the expected count/length of the
parameter is.

During rewrite we remove these attributes.
2017-07-28 06:16:48 +01:00
Fraser Waters ac05b22b11 Update Bind project to Framework 4.6.1 2017-07-27 16:50:11 +01:00
Christopher Lees bef43af969 Implement generic Consumer device which returns a button collection 2017-07-27 16:39:37 +01:00
Jarl Gullberg cd1bce55ef Merge pull request #602 from Nihlus/unix-unofficial-xamarin-android
Support building OpenTK.Android on Linux
2017-07-27 16:56:26 +02:00
Fraser Waters d6a05b4571 Run Generator.Bind
Fixes a load of whitespace errors and missing access modifies in ES.
Changes WaitSync to no longer return WaitSyncStatus (correct according to
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glWaitSync.xhtml,
looks like 020bb696f6 fixed this in the override
but Bind wasn't rerun).
2017-07-27 11:22:49 +01:00
varon bde5badee9 Merge pull request #598 from ppy/no-child-window
Remove child_window to support exclusive full screen in more scenarios
2017-07-26 20:05:58 +02:00
Jarl Gullberg 6eecf54c57
Readd missing drawing namespace. 2017-07-26 16:47:26 +02:00
Jarl Gullberg 3dc6ad223f
Add conditional directory overrides for Unix. 2017-07-26 16:47:26 +02:00
Jarl Gullberg e508cfdfde
Removed accidental terminal command. Window focusing is hard. 2017-07-26 16:42:19 +02:00
Jarl Gullberg b15d2dc622
Make sure that StyleCop.Analyzers is excluded from NuGet dependencies. 2017-07-26 16:42:19 +02:00
Jarl Gullberg ab8f2826e7
Drop Link attribute in favor of Link tag to allow building with MSBuild 14 2017-07-26 16:41:32 +02:00
Jarl Gullberg 577fb4e098
Forgot to add StyleCop.Analyzers to the other projects as well. 2017-07-26 16:41:32 +02:00
Jarl Gullberg b72c04bb3d
Enabled StyleCop inspections for all projects. This replaces AllRules. 2017-07-26 16:41:26 +02:00
Jarl Gullberg 2fd5486735
Added stylecop configuration file and rule set. 2017-07-26 16:41:14 +02:00
Jarl Gullberg 86f7c1945f
Added StyleCop.Analyzers to OpenTK.GLWidget 2017-07-26 16:41:14 +02:00
Jarl Gullberg 86113a4eeb
Added StyleCop.Analyzers to the solution. 2017-07-26 16:41:14 +02:00
Jarl Gullberg eb932264ad
Ensure that all projects bundle their debugging symbols. 2017-07-26 16:13:20 +02:00
UnknownShadow200 6e1d91ed4d Update bugs/issues urls to point to OpenTK github issues instead of defunct OpenTK.com 2017-07-26 17:20:00 +10:00
Dean Herbert 950cef3eae Remove child_window to support exclusive full screen in more scenarios 2017-07-25 14:22:29 +09:00
Dean Herbert e44aba39ed Fix white flash when starting GameWindow based application on windows 2017-07-25 11:56:05 +09:00
Vlad Kalyuzhny 2fca9b2b13 Fix cursor incorreclty moved out of window 2017-07-25 00:36:33 +03:00
Jarl Gullberg a3df3b38e5 Merge pull request #586 from Nihlus/mark-cls-compliant
Mark methods and classes in GLWidget with their CLS compliance
2017-07-24 17:22:52 +02:00
Jarl Gullberg ef89e71014
Removed redundant CLS-compliant attributes. 2017-07-24 16:11:45 +02:00
Jarl Gullberg 49244d26a4 Merge pull request #591 from Frassle/buildwarnings
Fix some simple build warnings
2017-07-24 16:08:26 +02:00
Fraser Waters 0dfaa414af Remove trailing space from bindings 2017-07-23 23:04:03 +01:00
Fraser Waters 35be46f06f Emit private modifier for binding points 2017-07-23 23:03:44 +01:00
Fraser Waters 5e5fc2adaa Remove trailing space in License file 2017-07-23 23:03:02 +01:00
Fraser Waters 89b7337061 Remove unused fields in MouseDevice 2017-07-23 16:02:23 +01:00
Fraser Waters f099ae6db7 Print Exception variable in Rewrite 2017-07-23 16:02:23 +01:00
Jarl Gullberg 009f6c5098
Marked some methods and classes in GLWidget with their CLS compliance. 2017-07-21 11:29:48 +02:00
Jarl Gullberg 643df9367f
Removed now empty preprocessor statement. 2017-07-20 21:42:58 +02:00
Jarl Gullberg 41d4bef7e2
Restore removed using statements from minimal classes. 2017-07-20 21:41:38 +02:00
Jarl Gullberg 4f562820f4
Correct malformed formatting. 2017-07-20 21:36:47 +02:00
Jarl Gullberg 53d3ce354f
Remove now empty preprocessor statement. 2017-07-20 21:36:11 +02:00
Jarl Gullberg 094580daa3
Removed unused using statements. 2017-07-20 21:32:51 +02:00
Jarl Gullberg 5b03732763 Merge pull request #575 from Nihlus/cleanup-5-enforce-braces
Enforce the use of braces for conditional statements
2017-07-20 21:22:18 +02:00
Jarl Gullberg 0c1901a4dd Merge pull request #582 from Nihlus/disable-redundant-warnings
Disable superfluous warnings in native interop code.
2017-07-20 21:19:29 +02:00
Jarl Gullberg 72034a4528 Merge pull request #583 from Nihlus/add-missing-xml
Add missing XML comments for GLHelper.
2017-07-20 19:58:38 +02:00
Jarl Gullberg e4e7fba52a
Add comment for #pragma disable 2017-07-20 19:58:10 +02:00
Jarl Gullberg 04ef9fc262
Remove references to unused function GetWindowDC. 2017-07-20 17:49:44 +02:00
Jarl Gullberg f77734ae60
Removed redundant literal variable name specifier. 2017-07-20 17:31:36 +02:00
Jarl Gullberg 8dcb252dc9
Corrected preprocessor alignment. 2017-07-20 17:30:46 +02:00
Jarl Gullberg 2ffc67b8ae
Corrected malformed formatting in GameWindow. 2017-07-20 17:29:12 +02:00
Jarl Gullberg e101f121b2
Add missing XML comments for GLHelper. 2017-07-20 17:26:08 +02:00
Jarl Gullberg ef96e7ab15 Merge pull request #581 from Nihlus/correct-xml-comment
Corrected XML comments to reflect now removed JoystickAxis enumeration.
2017-07-20 13:41:53 +02:00
Jarl Gullberg ba044162be Merge pull request #580 from Nihlus/remove-unused-field
Remove unused backing field from FileDropEventArgs.
2017-07-20 13:41:46 +02:00
Jarl Gullberg f4d09e030f
Disable superfluous warnings in native interop code. 2017-07-20 12:57:42 +02:00
Jarl Gullberg 56b51702c2
Corrected XML comments to reflect now removed JoystickAxis enumeration. 2017-07-20 12:49:03 +02:00
Jarl Gullberg 8974c0ee2b
Remove unused backing field from FileDropEventArgs. 2017-07-20 12:45:01 +02:00
Austin Chen 3686203a6a Fix broken Android and iOS builds 2017-07-19 00:24:43 -07:00
Jarl Gullberg 4f60f95607
Enforced the use of braces for conditional statements. 2017-07-17 19:24:51 +02:00
Jarl Gullberg 5f2d3144c4
Enforced use of explicit private modifiers. 2017-07-17 18:51:54 +02:00
Fraser Waters f1362eef2b Merge pull request #574 from Frassle/bind_settings
Update Generator.Bind default settings for new repo layout
2017-07-17 17:20:31 +01:00
Jarl Gullberg 4ff4874df9 Merge pull request #572 from Nihlus/converter-better-options
Replace bundled Mono.Options in Converter
2017-07-17 18:04:49 +02:00
Fraser Waters 812a4f83ab Update Generator.Bind default settings for new repo layout 2017-07-17 10:37:40 +01:00
Jarl Gullberg ee09c798e4 Merge pull request #565 from leezer3/JoystickAxis
Change: Bump joystick axis limit to 64 & remove JoystickAxis enum
2017-07-16 22:31:16 +02:00