GLFW integration problem
Posted: Fri Jan 19, 2018 4:35 pm
Hi everyone.
I'm trying to use both Irrlicht and GLFW in my game. I create a Window with GLFW like this:
And then i initialize Irrlicht like this:
But when i execute i get this errors:
glXCreateNewContext in CIrrDeviceLinux or in CGLXManager depending on the version of irrlicht
There is any way to fix it?
Thank you!
I'm trying to use both Irrlicht and GLFW in my game. I create a Window with GLFW like this:
Code: Select all
glfwInit();
glfwSetTime(0);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_SAMPLES, 0);
glfwWindowHint(GLFW_RED_BITS, 4);
glfwWindowHint(GLFW_GREEN_BITS, 4);
glfwWindowHint(GLFW_BLUE_BITS, 4);
glfwWindowHint(GLFW_ALPHA_BITS, 1);
glfwWindowHint(GLFW_DEPTH_BITS, 24);
glfwWindowHint(GLFW_STENCIL_BITS, 1);
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);
// Create a GLFWwindow object
GLFWwindow* window = glfwCreateWindow(800, 800, "example3", nullptr, nullptr);
if (window == nullptr) {
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
Code: Select all
// Initialize irrlicht
SIrrlichtCreationParameters param;
param.DeviceType = E_DEVICE_TYPE::EIDT_X11;
param.DriverType = video::E_DRIVER_TYPE::EDT_OPENGL;
param.WindowId = reinterpret_cast<void*>(glfwGetX11Window(window));
param.IgnoreInput = true;
IrrlichtDevice* device = createDeviceEx(param);
It seems the error came from this function:Creating X window...
X Error: BadMatch (invalid parameter attributes)
From call : unknown
X Error: GLXBadDrawable
From call : unknown
Context activation failed.
glXCreateNewContext in CIrrDeviceLinux or in CGLXManager depending on the version of irrlicht
There is any way to fix it?
Thank you!