From 564de024b2b5d2c702b7d5d6e9b2fb57da6806f5 Mon Sep 17 00:00:00 2001 From: Victor Koenders Date: Wed, 23 Nov 2016 20:08:47 +0100 Subject: [PATCH 1/3] Moved gl.rs to the correct folder and made the um-gl feature --- Cargo.toml | 2 ++ src/gl.rs | 35 ----------------------------------- src/um/gl/gl.rs | 42 ++++++++++++++++++++++++++++++++++++++++++ src/um/mod.rs | 4 ++++ 4 files changed, 48 insertions(+), 35 deletions(-) delete mode 100644 src/gl.rs create mode 100644 src/um/gl/gl.rs diff --git a/Cargo.toml b/Cargo.toml index 51cd2833e..742d27ef2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -130,6 +130,7 @@ headers = ["headers-shared", "headers-um", "headers-vc", "headers-winrt"] "um-dwrite", "um-errhandlingapi", "um-fileapi", + "um-gl", "um-handleapi", "um-heapapi", "um-http", @@ -201,6 +202,7 @@ headers = ["headers-shared", "headers-um", "headers-vc", "headers-winrt"] "um-dwrite" = ["shared-basetsd", "shared-minwindef", "shared-windef", "shared-winerror", "um-dcommon", "um-unknwnbase", "um-wingdi", "um-winnt"] "um-errhandlingapi" = ["um-winnt"] "um-fileapi" = ["shared-minwindef", "um-minwinbase", "um-winnt"] +"um-gl" = [] "um-handleapi" = ["shared-minwindef", "um-winnt", "kernel32"] "um-heapapi" = ["shared-basetsd", "shared-minwindef"] "um-http" = ["shared-guiddef", "shared-minwindef", "shared-sspi", "um-winnt", "um-winsock2"] diff --git a/src/gl.rs b/src/gl.rs deleted file mode 100644 index 006c37e41..000000000 --- a/src/gl.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright © 2015, Peter Atashian -// Licensed under the MIT License -//48 -pub type GLenum = ::c_uint; -pub type GLboolean = ::c_uchar; -pub type GLbitfield = ::c_uint; -pub type GLbyte = ::c_schar; -pub type GLshort = ::c_short; -pub type GLint = ::c_int; -pub type GLsizei = ::c_int; -pub type GLubyte = ::c_uchar; -pub type GLushort = ::c_ushort; -pub type GLuint = ::c_uint; -pub type GLfloat = ::c_float; -pub type GLclampf = ::c_float; -pub type GLdouble = ::c_double; -pub type GLclampd = ::c_double; -pub type GLvoid = ::c_void; -//63 -//68 -//AccumOp -pub const GL_ACCUM: GLenum = 0x0100; -pub const GL_LOAD: GLenum = 0x0101; -pub const GL_RETURN: GLenum = 0x0102; -pub const GL_MULT: GLenum = 0x0103; -pub const GL_ADD: GLenum = 0x0104; -//AlphaFunction -pub const GL_NEVER: GLenum = 0x0200; -pub const GL_LESS: GLenum = 0x0201; -pub const GL_EQUAL: GLenum = 0x0202; -pub const GL_LEQUAL: GLenum = 0x0203; -pub const GL_GREATER: GLenum = 0x0204; -pub const GL_NOTEQUAL: GLenum = 0x0205; -pub const GL_GEQUAL: GLenum = 0x0206; -pub const GL_ALWAYS: GLenum = 0x0207; diff --git a/src/um/gl/gl.rs b/src/um/gl/gl.rs new file mode 100644 index 000000000..78eae6600 --- /dev/null +++ b/src/um/gl/gl.rs @@ -0,0 +1,42 @@ +// Copyright © 2015, Peter Atashian +// Licensed under the MIT License + +use ctypes::{c_double, c_float, c_int, c_uchar, c_uint, c_ushort, c_schar, c_short, c_void}; + +//48 +pub type GLenum = c_uint; +pub type GLboolean = c_uchar; +pub type GLbitfield = c_uint; +pub type GLbyte = c_schar; +pub type GLshort = c_short; +pub type GLint = c_int; +pub type GLsizei = c_int; +pub type GLubyte = c_uchar; +pub type GLushort = c_ushort; +pub type GLuint = c_uint; +pub type GLfloat = c_float; +pub type GLclampf = c_float; +pub type GLdouble = c_double; +pub type GLclampd = c_double; +pub type GLvoid = c_void; +//63 +//68 +//AccumOp +pub const GL_ACCUM: GLenum = 0x0100; +pub const GL_LOAD: GLenum = 0x0101; +pub const GL_RETURN: GLenum = 0x0102; +pub const GL_MULT: GLenum = 0x0103; +pub const GL_ADD: GLenum = 0x0104; +//AlphaFunction +pub const GL_NEVER: GLenum = 0x0200; +pub const GL_LESS: GLenum = 0x0201; +pub const GL_EQUAL: GLenum = 0x0202; +pub const GL_LEQUAL: GLenum = 0x0203; +pub const GL_GREATER: GLenum = 0x0204; +pub const GL_NOTEQUAL: GLenum = 0x0205; +pub const GL_GEQUAL: GLenum = 0x0206; +pub const GL_ALWAYS: GLenum = 0x0207; + +// TODO: we're missing about 1500 lines of defines and methods +// until that time, you can use the excellent GL crate +// https://github.com/brendanzab/gl-rs \ No newline at end of file diff --git a/src/um/mod.rs b/src/um/mod.rs index 4f5db795c..b29813fa9 100644 --- a/src/um/mod.rs +++ b/src/um/mod.rs @@ -4,7 +4,11 @@ // , at your option. // All files in the project carrying such notice may not be copied, modified, or distributed // except according to those terms. + +pub mod gl; + //! Headers for user mode only + #[cfg(feature = "um-audioclient")] pub mod audioclient; #[cfg(feature = "um-audiosessiontypes")] pub mod audiosessiontypes; #[cfg(feature = "um-cfgmgr32")] pub mod cfgmgr32; From 9bf1478f92ed6d4a9ea6d7e785f2f69c6b5cebcf Mon Sep 17 00:00:00 2001 From: Victor Koenders Date: Wed, 23 Nov 2016 20:14:44 +0100 Subject: [PATCH 2/3] Added missing um/gl/mod.rs file --- src/um/gl/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/um/gl/mod.rs diff --git a/src/um/gl/mod.rs b/src/um/gl/mod.rs new file mode 100644 index 000000000..b88452bbc --- /dev/null +++ b/src/um/gl/mod.rs @@ -0,0 +1,9 @@ +// Copyright © 2016 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +//! Headers for user mode only + +#[cfg(feature = "um-gl")] pub mod gl; \ No newline at end of file From 6835967a078a406610488504fb8f7b24ba3685c4 Mon Sep 17 00:00:00 2001 From: Victor Koenders Date: Wed, 23 Nov 2016 20:19:31 +0100 Subject: [PATCH 3/3] Moved doc header comment in the right position. That's what you get for changing things without testing them --- src/um/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/um/mod.rs b/src/um/mod.rs index b29813fa9..488e7a6ee 100644 --- a/src/um/mod.rs +++ b/src/um/mod.rs @@ -4,11 +4,10 @@ // , at your option. // All files in the project carrying such notice may not be copied, modified, or distributed // except according to those terms. +//! Headers for user mode only pub mod gl; -//! Headers for user mode only - #[cfg(feature = "um-audioclient")] pub mod audioclient; #[cfg(feature = "um-audiosessiontypes")] pub mod audiosessiontypes; #[cfg(feature = "um-cfgmgr32")] pub mod cfgmgr32;