Bonjour à tous,
Je suis assez novice en ce qui concerne Maven et je cherche à installer LWJGL en tant que dépendance. J'ai récupéré le pom.xml à partir du site de LWJGL et je l'ai intégré au mien.
Malheureusement sur la classe de test proposé par LWJGL, Eclipse trouve certains imports mais pas d'autres, c'est assez incompréhensible :/
Auriez vous une solution ?
Merci d'avoir pris le temps de me lire.
Mon pom.xml
Code XML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>fr.qilat</groupId> <artifactId>AThirdGame</artifactId> <version>0.0.1-SNAPSHOT</version> <name>A Third Game</name> <profiles> <profile><id>lwjgl-natives-linux></id><activation><os><family>unix</family></os></activation><properties><lwjgl.natives>natives-linux</lwjgl.natives></properties></profile> <profile><id>lwjgl-natives-macos></id><activation><os><family>mac</family></os></activation><properties><lwjgl.natives>natives-macos</lwjgl.natives></properties></profile> <profile><id>lwjgl-natives-windows></id><activation><os><family>windows</family></os></activation><properties><lwjgl.natives>natives-windows</lwjgl.natives></properties></profile> </profiles> <dependencies> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-assimp</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-bgfx</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-egl</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-glfw</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-jawt</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-jemalloc</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-lmdb</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nanovg</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nfd</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nuklear</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-openal</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opencl</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengles</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-par</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-sse</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-stb</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-tinyfd</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-vulkan</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-xxhash</artifactId><version>3.1.1</version></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-assimp</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-bgfx</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-glfw</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-jemalloc</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-lmdb</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nanovg</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nfd</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-nuklear</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-openal</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengl</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-opengles</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-par</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-sse</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-stb</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-tinyfd</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.lwjgl</groupId><artifactId>lwjgl-xxhash</artifactId><version>3.1.1</version><classifier>${lwjgl.natives}</classifier><scope>runtime</scope></dependency> <dependency><groupId>org.joml</groupId><artifactId>joml</artifactId><version>1.9.2</version></dependency> <dependency><groupId>com.code-disaster.steamworks4j</groupId><artifactId>steamworks4j</artifactId><version>1.6.1</version></dependency> </dependencies> </project>
La classe en question :
Mes différentes erreurs :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117 package fr.imagicraft.athirdgame; import org.lwjgl.*; import org.lwjgl.glfw.*; import org.lwjgl.opengl.*; import org.lwjgl.system.*; import java.nio.*; import static org.lwjgl.glfw.Callbacks.*; import org.lwjgl.glfw.GLFW.*; import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.system.MemoryStack.*; import static org.lwjgl.system.MemoryUtil.*; public class Main { // The window handle private long window; public void run() { System.out.println("Hello LWJGL " + Version.getVersion() + "!"); init(); loop(); // Free the window callbacks and destroy the window glfwFreeCallbacks(window); glfwDestroyWindow(window); // Terminate GLFW and free the error callback glfwTerminate(); glfwSetErrorCallback(null).free(); } private void init() { // Setup an error callback. The default implementation // will print the error message in System.err. GLFWErrorCallback.createPrint(System.err).set(); // Initialize GLFW. Most GLFW functions will not work before doing this. if ( !glfwInit() ) throw new IllegalStateException("Unable to initialize GLFW"); // Configure GLFW glfwDefaultWindowHints(); // optional, the current window hints are already the default glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); // the window will stay hidden after creation glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); // the window will be resizable // Create the window window = glfwCreateWindow(300, 300, "Hello World!", NULL, NULL); if ( window == NULL ) throw new RuntimeException("Failed to create the GLFW window"); // Setup a key callback. It will be called every time a key is pressed, repeated or released. glfwSetKeyCallback(window, (window, key, scancode, action, mods) -> { if ( key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE ) glfwSetWindowShouldClose(window, true); // We will detect this in the rendering loop }); // Get the thread stack and push a new frame try ( MemoryStack stack = stackPush() ) { IntBuffer pWidth = stack.mallocInt(1); // int* IntBuffer pHeight = stack.mallocInt(1); // int* // Get the window size passed to glfwCreateWindow glfwGetWindowSize(window, pWidth, pHeight); // Get the resolution of the primary monitor GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor()); // Center the window glfwSetWindowPos( window, (vidmode.width() - pWidth.get(0)) / 2, (vidmode.height() - pHeight.get(0)) / 2 ); } // the stack frame is popped automatically // Make the OpenGL context current glfwMakeContextCurrent(window); // Enable v-sync glfwSwapInterval(1); // Make the window visible glfwShowWindow(window); } private void loop() { // This line is critical for LWJGL's interoperation with GLFW's // OpenGL context, or any context that is managed externally. // LWJGL detects the context that is current in the current thread, // creates the GLCapabilities instance and makes the OpenGL // bindings available for use. GL.createCapabilities(); // Set the clear color glClearColor(1.0f, 0.0f, 0.0f, 0.0f); // Run the rendering loop until the user has attempted to close // the window or has pressed the ESCAPE key. while ( !glfwWindowShouldClose(window) ) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the framebuffer glfwSwapBuffers(window); // swap the color buffers // Poll for window events. The key callback above will only be // invoked during this call. glfwPollEvents(); } } public static void main(String[] args) { new Main().run(); } }
![]()
Partager