Hello Guest

Recent Posts

Pages: 1 ... 8 9 [10]
91
LWJGL Documentation / Re: Installing lwjgl 3 for eclipse using gradle
« Last post by KaiHH on March 21, 2019, 08:49:04 »
You are getting the error because the snippet generator on lwjgl.org/customize will only generate what is necessary to integrate LWJGL into your Gradle/Maven project file. It does not generate a complete build file as that will highly depend on your preferences or other configurations you chose for your project.
What you can do is first download Gradle (of course) and then cd into a directory where you want to initialize your project and then execute `gradle init` and answer its questions. This will generate a complete gradle setup for you.
92
LWJGL Documentation / Re: Installing lwjgl 3 for eclipse using gradle
« Last post by Tclord on March 20, 2019, 23:34:17 »
Wow, you really make it sound amazing!  So yes, I would like to use gradle.  And so I've been looking around and trying to learn more about it.  Seems similar to make, which I've used in the past.  I'm unclear how to get it to work with eclipse though.  I try going to File -> Import -> Existing Gradle Project, point it to a directory where I put the build.gradle file, and I ultimately end up with the following error:

Code: [Select]
Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.8.1-bin.zip'.
Build file 'D:\Dev\lwjgl-3.2.1\build.gradle' line: 11
A problem occurred evaluating root project 'lwjgl-3.2.1'.
Could not find method implementation() for arguments [org.lwjgl:lwjgl:3.2.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Things are not seeming very intuitive, and I don't really know where to go exactly for answers.  It always seems like getting setup to program is always more difficult than actually programming.  Was true 20 years ago and appears to still be true today.  I am an experienced programmer, btw.  While new to Java and it's trappings, I have a lot of experience with C/C++, though I admit I've haven't really been active with it that recently.  I have worked with OpenGL before, with C++ through the SDL library, and I'm thinking that lwjgl is kind of similar in nature to what SDL is all about, which is why I wanted to utilize it.  I think I would be good to go if I could just figure out how to get eclipse and lwjgl working together in harmony.  If you can suggest any good starting points for learning gradle from the ground up, would be much appreciated.
93
LWJGL Documentation / Re: Installing lwjgl 3 for eclipse using gradle
« Last post by KaiHH on March 20, 2019, 17:20:51 »
Considering any possible future for you as a programmer, I'd say learning Gradle/Maven instead of LWJGL is a hugely better investment. On top of that: When people say "learning LWJGL" most of the time what they actually wanted to say was "learning OpenGL".
What I observe is that there is a somewhat big misunderstanding in the world of people watching YouTube tutorials/videos what LWJGL is. LWJGL is an enabling technology to just be able to use OpenGL, OpenAL, OpenCL, Vulkan, and a whole host of other native libraries, in Java via JNI. On top of that, it provides handling native/off-heap memory. And that's basically it.
So, when you are learning LWJGL you are learning OpenGL.

Now on the topic of build systems: Using a build system has little to do with the complexity of your project. There are so many valuable benefits that Maven/Gradle will bring to you compared to a manual setup in Eclipse:
1. With a single click of a button or command line execution you can automatically retrieve the latest version of all LWJGL libraries you use
2. IDEs provide automatic setup of a Maven/Gradle project. You don't have to download the LWJGL and potentially other libraries from somewhere, unpack the zip into some folder, open some IDE like Eclipse and setup the libraries there properly. All of this is done automatically. So: Maven pom.xml or Gradle build.gradle file read? -> boom! IDE configuration auto-generated by the IDE when importing the project description.
3. Most of the benefits are for collaborative work, though: Being able to build a project WITHOUT people having to have an IDE (i.e. the same IDE) like Eclipse installed. This enables continuous build with a build server like Travis.

The bottom line is: Even simply using Maven/Gradle to setup your project is way simpler and requires faaar fewer steps than setup using a zip file you have to manually download, unpack and setup in your IDE.
94
LWJGL Documentation / Re: Installing lwjgl 3 for eclipse using gradle
« Last post by Tclord on March 20, 2019, 17:09:02 »
Ya, sorry.  I think I'm getting it now.  I didn't initially realize it was a build/make system.  I was under the impression is was some kind of automated installation/integration system for getting lwjgl and eclipse fused together so to speak.  Instead, I'm guessing this build.gradle is kind of an initial make file that handles building the lwjgl parts, and you'd expand on this file to include handling of your own project.  That might not be quite right but maybe close enough to the general idea.  So misunderstanding on my part.  Thanks for your patience.  I think I'll just go with the zip for now and revisit the gradle stuff later since I'm not doing anything complex enough right now to justify using it.  More important things to learn first like how to use lwjgl. :)
95
LWJGL Documentation / Re: Installing lwjgl 3 for eclipse using gradle
« Last post by spasi on March 20, 2019, 09:04:35 »
Both Maven and Gradle are extremely popular in the Java development community and there is a staggering amount of documentation/tutorials/examples available. Sorry, but teaching people how to use build systems is outside the scope of the LWJGL project. We don't have the resources to do it and it would be huge waste of time for no benefit at all. If you don't have experience with either and don't want to invest time in becoming familiar with them, you could use the zip distribution and setup the Eclipse project manually, that's totally fine (otherwise it wouldn't be an available option).
96
LWJGL Documentation / Installing lwjgl 3 for eclipse using gradle
« Last post by Tclord on March 20, 2019, 00:26:31 »
The 1.2.-Install webpage under the eclipse section "highly recommends" using gradle/maven, so I figure that is probably what I should do.  Unfortunately I don't really know much of anything about either.  I research a bit and it seems like I should probably go with gradle.  I build a gradle download bundle whatever from the download page and I get a build.gradle file which I have no idea what to do with now.  It seems like everywhere I look everyone is just getting a zip and coping all the jar files into a new library folder.  So I get the impression nobody really uses the "high recommendation".  But maybe I am just misunderstanding something.  Is this a recommendation only if you are experienced with gradle or maven, and if not just use the zip file option?  If so, might be good to say something along those lines on this install webpage so folks like me don't get so confused.  So, if I should really be going the gradle route, could someone explain what I need to do with this build.gradle file and whatever else I might need to do to get eclipse to use it, etc.  The install page only says to use a gradle/maven project, but says nothing about how to use it.  If I should just do the zip copy to library thing than that's fine, just say so or if no one answers I'll just assume zip is the way to go and pretend I was never highly recommended to use gradle to begin with. :)
97
You are a lifesaver! Thank you, that's much cleaner.

The only downside is that the window hints (in particular, the "decorated" flag) can only be set when the window is first created, but I can live with that.

I am still curious about that error. I don't have time right now to produce a self-contained sample, but I may be back.
98
OpenGL / Re: Memory corruption during glfwTerminate
« Last post by jorrit on March 17, 2019, 09:49:53 »
Oh thanks. I totally missed that
99
OpenGL / Re: Memory corruption during glfwTerminate
« Last post by KaiHH on March 17, 2019, 09:47:06 »
Look at your Buffer.init() method. You free the verticesBuffer twice by calling memFree(verticesBuffer) twice.
Code: [Select]
    private void init() {
        FloatBuffer verticesBuffer = MemoryUtil.memAllocFloat(vertices.length);
        verticesBuffer.put(vertices).flip();

        vaoId = glGenVertexArrays();
        glBindVertexArray(vaoId);

        vboId = glGenBuffers();
        glBindBuffer(GL_ARRAY_BUFFER, vboId);
        glBufferData(GL_ARRAY_BUFFER, verticesBuffer, GL_STATIC_DRAW);
        memFree(verticesBuffer); // <- FREE HERE!!!

        glVertexAttribPointer(0, 3, GL_FLOAT, false, 0, 0);

        glBindBuffer(GL_ARRAY_BUFFER, 0);
        glBindVertexArray(0);

        if (verticesBuffer != null) { // <- is true
            MemoryUtil.memFree(verticesBuffer); // <- AND HERE!!!
        }
    }
100
OpenGL / Memory corruption during glfwTerminate
« Last post by jorrit on March 17, 2019, 09:33:44 »
Hi all,

I have a problem with a memory corruption during glfwTerminate. When I run this program and press esc to exit I get this:

Renderer.destroy: 1
malloc(): memory corruption

The problem goes away if I don't create and destroy the Buffer object so I guess it has something to do with that. But I can't figure out what's wrong. I'm using lwjgl 3.2.1.1 on Linux

All the code (minimized as much as I could):
https://gist.github.com/McJty/69a7130ce54caf765434c3af865d1b1a

Thanks in advance
Pages: 1 ... 8 9 [10]