Skip to content

Commit

Permalink
c: disables MX_GLOBAL
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Oct 21, 2022
1 parent c469e78 commit cf4badb
Show file tree
Hide file tree
Showing 24 changed files with 15 additions and 34 deletions.
12 changes: 6 additions & 6 deletions glad/generator/c/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ class CConfig(Config):
default=False,
description='Enables support for multiple GL contexts'
)
MX_GLOBAL = ConfigOption(
converter=bool,
default=False,
description='Mimic global GL functions with context switching'
)
# MX_GLOBAL = ConfigOption(
# converter=bool,
# default=False,
# description='Mimic global GL functions with context switching'
# )
HEADER_ONLY = ConfigOption(
converter=bool,
default=False,
Expand All @@ -241,7 +241,7 @@ class CConfig(Config):
)

__constraints__ = [
RequirementConstraint(['MX_GLOBAL'], 'MX'),
# RequirementConstraint(['MX_GLOBAL'], 'MX'),
UnsupportedConstraint(['MX'], 'DEBUG'),
# RequirementConstraint(['MX', 'DEBUG'], 'MX_GLOBAL')
UnsupportedConstraint(['MX'], 'ON_DEMAND')
Expand Down
3 changes: 1 addition & 2 deletions test/c/compile/gl/header-only+mx/001/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Full compatibility GL MX header only
*
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility" c --loader --mx --mx-global --header-only
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility" c --loader --mx --header-only
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -11,7 +11,6 @@

int main(void) {
GladGLContext gl = {0};
(void) gladLoaderLoadGL();
(void) gladLoaderLoadGLContext(&gl);
return 0;
}
3 changes: 1 addition & 2 deletions test/c/compile/gl/header-only+mx/002/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Full core GL MX header only
*
* GLAD: $GLAD --out-path=$tmp --api="gl:core" c --loader --mx --mx-global --header-only
* GLAD: $GLAD --out-path=$tmp --api="gl:core" c --loader --mx --header-only
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -11,7 +11,6 @@

int main(void) {
GladGLContext gl = {0};
(void) gladLoaderLoadGL();
(void) gladLoaderLoadGLContext(&gl);
return 0;
}
3 changes: 1 addition & 2 deletions test/c/compile/gl/header-only+mx/003/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* No extensions compatibility GL MX header only
*
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility" --extensions="" c --loader --mx --mx-global --header-only
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility" --extensions="" c --loader --mx --header-only
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -11,7 +11,6 @@

int main(void) {
GladGLContext gl = {0};
(void) gladLoaderLoadGL();
(void) gladLoaderLoadGLContext(&gl);
return 0;
}
3 changes: 1 addition & 2 deletions test/c/compile/gl/header-only+mx/004/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* No extensions core GL MX header only
*
* GLAD: $GLAD --out-path=$tmp --api="gl:core" --extensions="" c --loader --mx --mx-global --header-only
* GLAD: $GLAD --out-path=$tmp --api="gl:core" --extensions="" c --loader --mx --header-only
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -11,7 +11,6 @@

int main(void) {
GladGLContext gl = {0};
(void) gladLoaderLoadGL();
(void) gladLoaderLoadGLContext(&gl);
return 0;
}
3 changes: 1 addition & 2 deletions test/c/compile/gl/header-only+mx/005/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MX header only GL 2.1 All extensions
*
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility=2.1" c --loader --mx --mx-global --header-only
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility=2.1" c --loader --mx --header-only
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -11,7 +11,6 @@

int main(void) {
GladGLContext gl = {0};
(void) gladLoaderLoadGL();
(void) gladLoaderLoadGLContext(&gl);
return 0;
}
3 changes: 1 addition & 2 deletions test/c/compile/gl/header-only+mx/006/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MX header only GL 2.1 No extensions
*
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility=2.1" --extensions="" c --loader --mx --mx-global --header-only
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility=2.1" --extensions="" c --loader --mx --header-only
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -11,7 +11,6 @@

int main(void) {
GladGLContext gl = {0};
(void) gladLoaderLoadGL();
(void) gladLoaderLoadGLContext(&gl);
return 0;
}
9 changes: 1 addition & 8 deletions test/c/compile/gl/header-only+mx/007/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MX header only, global generation, should compile basic API
*
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility" c --loader --mx --mx-global --header-only
* GLAD: $GLAD --out-path=$tmp --api="gl:compatibility" c --loader --mx --header-only
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -26,14 +26,7 @@ int main(void) {
GladGLContext gl = {0};

gladLoadGLContextUserPtr(&gl, loader_userptr, NULL);
gladLoadGLContext(&gl, loader);
gladLoaderLoadGLContext(&gl);

gladLoadGLUserPtr(loader_userptr, NULL);
gladLoadGL(loader);
gladLoaderLoadGL();

gladSetGLContext(&gl);
(void) gladGetGLContext();
return 0;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 1 addition & 4 deletions test/c/compile/vulkan/header-only+mx/001/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Full vulkan, header only, mx
*
* GLAD: $GLAD --out-path=$tmp --api="vulkan" c --loader --header-only --mx --mx-global
* GLAD: $GLAD --out-path=$tmp --api="vulkan" c --loader --header-only --mx
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -15,11 +15,8 @@ VOID_FUNCPTR loader(const char *name) { (void) name; return NULL; }

int main(void) {
GladVulkanContext context = {0};
(void) gladLoadVulkanUserPtr(NULL, loader_userptr, NULL);
(void) gladLoadVulkanContextUserPtr(&context, NULL, loader_userptr, NULL);
(void) gladLoadVulkan(NULL, loader);
(void) gladLoadVulkanContext(&context, NULL, loader);
(void) gladLoaderLoadVulkan(NULL, NULL, NULL);
(void) gladLoaderLoadVulkanContext(&context, NULL, NULL, NULL);
return 0;
}
5 changes: 1 addition & 4 deletions test/c/compile/vulkan/header-only+mx/002/test.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Full vulkan without extensions, header only, mx
*
* GLAD: $GLAD --out-path=$tmp --api="vulkan" --extensions="" c --loader --header-only --mx --mx-global
* GLAD: $GLAD --out-path=$tmp --api="vulkan" --extensions="" c --loader --header-only --mx
* COMPILE: $GCC $test -o $tmp/test -I$tmp/include -ldl
* RUN: $tmp/test
*/
Expand All @@ -15,11 +15,8 @@ VOID_FUNCPTR loader(const char *name) { (void) name; return NULL; }

int main(void) {
GladVulkanContext context = {0};
(void) gladLoadVulkanUserPtr(NULL, loader_userptr, NULL);
(void) gladLoadVulkanContextUserPtr(&context, NULL, loader_userptr, NULL);
(void) gladLoadVulkan(NULL, loader);
(void) gladLoadVulkanContext(&context, NULL, loader);
(void) gladLoaderLoadVulkan(NULL, NULL, NULL);
(void) gladLoaderLoadVulkanContext(&context, NULL, NULL, NULL);
return 0;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cf4badb

Please sign in to comment.