()
| 13 | import org.lwjgl.opengl.GL; |
| 14 | import org.lwjgl.opengl.GL11; |
| 15 | import org.lwjgl.opengl.GL43; |
| 16 | import org.lwjgl.opengl.GLUtil; |
| 17 | |
| 18 | import static org.lwjgl.glfw.GLFW.*; |
| 19 | import static org.lwjgl.glfw.GLFW.GLFW_STICKY_MOUSE_BUTTONS; |
| 20 | |
| 21 | public class Scratch implements Runnable { |
| 22 | |
| 23 | |
| 24 | private long window; |
| 25 | |
| 26 | @Override |
| 27 | public void run() { |
| 28 | |
| 29 | // experimenting with moving this initialization first. Seems to remove the occasional crash on startup? |
| 30 | // new Thread(() -> { |
| 31 | // System.err.println(" building the CefSystem"); |
| 32 | CefSystem sys = CefSystem.cefSystem; |
| 33 | // System.err.println(" finished building the CefSystem"); |
| 34 | // }).start(); |
| 35 | |
| 36 | glfwInit(); |
| 37 | |
| 38 | glfwWindowHint(GLFW_DEPTH_BITS, 24); |
| 39 | glfwWindowHint(GLFW_COCOA_GRAPHICS_SWITCHING, 1); |
| 40 | glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); |
| 41 | glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, 1); |
| 42 | glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); |
| 43 | glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); |
| 44 | glfwWindowHint(GLFW_DOUBLEBUFFER, 1); |
| 45 | glfwWindowHint(GLFW_DECORATED, 1); |
| 46 | window = glfwCreateWindow(500, 500, "Hello?", 0, 0); |
| 47 | |
| 48 | glfwSetWindowPos(window, 50, 50); |
| 49 | |
| 50 | glfwSetCursorPosCallback(window, new GLFWCursorPosCallback(){ |
| 51 | @Override |
| 52 | public void invoke(long window, double xpos, double ypos) { |
| 53 | System.out.println(" cursor post :"+window+" "+xpos+" "+ypos); |
| 54 | } |
| 55 | }); |
| 56 | glfwShowWindow(window); |
| 57 | |
| 58 | glfwMakeContextCurrent(window); |
| 59 | /*glfwSwapInterval(0); |
| 60 | |
| 61 | GL11.glClearColor(0.25f, 0.25f, 0.25f, 1); |
| 62 | GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); |
| 63 | |
| 64 | glfwSwapBuffers(window); |
| 65 | |
| 66 | glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, GL11.GL_TRUE); |
| 67 | */ |
| 68 | |
| 69 | GL.createCapabilities(); |
| 70 | |
| 71 | // Set the clear color |
| 72 | GL11.glClearColor(1.0f, 0.0f, 0.0f, 0.0f); |
nothing calls this directly
no test coverage detected