diff --git a/source/tests/glbinding-test/CMakeLists.txt b/source/tests/glbinding-test/CMakeLists.txt index 4ca3cfec..6d4e1f97 100644 --- a/source/tests/glbinding-test/CMakeLists.txt +++ b/source/tests/glbinding-test/CMakeLists.txt @@ -32,6 +32,8 @@ set(sources RingBuffer_test.cpp SharedBitfield_test.cpp Boolean_compilation_test.cpp + MultiContext_test.cpp + MultiThreading_test.cpp # regession tests Regression_test_82.cpp diff --git a/source/tests/glbinding-test/MultiContext_test.cpp b/source/tests/glbinding-test/MultiContext_test.cpp index fd9faf1e..d9d94bbe 100644 --- a/source/tests/glbinding-test/MultiContext_test.cpp +++ b/source/tests/glbinding-test/MultiContext_test.cpp @@ -5,15 +5,16 @@ #include #include -#include -#include #include #include +#include +#include #include using namespace gl; using namespace glbinding; +using namespace aux; class MultiContext_test : public testing::Test { @@ -54,7 +55,9 @@ TEST_F(MultiContext_test, Test) EXPECT_NE(nullptr, window2); glfwMakeContextCurrent(window1); - Binding::initialize(false); + glbinding::initialize(0, [](const char * name) { + return glfwGetProcAddress(name); + }); #ifdef SYSTEM_WINDOWS EXPECT_EQ(Version(3, 2), ContextInfo::version()); @@ -67,11 +70,13 @@ TEST_F(MultiContext_test, Test) #endif glfwMakeContextCurrent(window2); - Binding::initialize(false); + glbinding::initialize(1, [](const char * name) { + return glfwGetProcAddress(name); + }); - Binding::releaseCurrentContext(); + Binding::releaseContext(1); glfwMakeContextCurrent(window1); - Binding::releaseCurrentContext(); + Binding::releaseContext(2); glfwTerminate(); } diff --git a/source/tests/glbinding-test/MultiThreading_test.cpp b/source/tests/glbinding-test/MultiThreading_test.cpp index a9aaf367..f0ebdd11 100644 --- a/source/tests/glbinding-test/MultiThreading_test.cpp +++ b/source/tests/glbinding-test/MultiThreading_test.cpp @@ -6,10 +6,9 @@ #include #include -#include -#include #include #include +#include #include @@ -60,7 +59,9 @@ TEST_F(MultiThreading_test, Test) std::thread t1([window1]() { glfwMakeContextCurrent(window1); - Binding::initialize(false); + glbinding::initialize(0, [](const char * name) { + return glfwGetProcAddress(name); + }); std::this_thread::sleep_for(std::chrono::milliseconds(5)); @@ -82,7 +83,9 @@ TEST_F(MultiThreading_test, Test) std::thread t2([window2]() { glfwMakeContextCurrent(window2); - Binding::initialize(false); + glbinding::initialize(1, [](const char * name) { + return glfwGetProcAddress(name); + }); std::this_thread::sleep_for(std::chrono::milliseconds(4));