LWJGL 3 change OpenGL context / ContextAttribs alternative -


in lwjgl 2 use older profile of opengl that:

pixelformat pixelformat = new pixelformat(); contextattribs contextatrributes = new contextattribs(3, 2) //<--             .withprofilecore(true)             .withforwardcompatible(true);  display.setdisplaymode(new displaymode(width, height)); display.settitle(window_title); display.create(pixelformat, contextatrributes); 

in lwjgl 3 there no display class anymore, how can there?

use glfwwindowhint contextattribs:

glfwwindowhint(glfw_context_version_major, 3); glfwwindowhint(glfw_context_version_minor, 2); glfwwindowhint(glfw_opengl_profile, glfw_opengl_core_profile); glfwwindowhint(glfw_opengl_forward_compat, glfw_true); 

then

glfwcreatewindow(width, height, title, 0, 0) 

glfwwindowhint can change options found in pixelformat, , defaults different may want to.

you need call glfwinit() before of this.

more complete guide can found here: http://www.lwjgl.org/guide


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -