LWJGL Forum

Please login or register.

Login with username, password and session length
Pages: 1 [2] 3 4 ... 10
 11 
 on: October 10, 2017, 21:57:35 
Started by LapisSea - Last post by LapisSea
Hi I relatively recently started upgraded to lwjgl3 and I am not quite sure what is the difference between
Code: [Select]
try(MemoryStack stack=stackPush()){

    doSmth(stack.mallocInt(foo));
    doSmthElse(stack.mallocInt(bar));

}
and
Code: [Select]
IntBuffer fooBuf=MemoryUtil.memAllocInt(foo);
doSmth(fooBuf);
fooBuf.free();

IntBuffer barBuf=MemoryUtil.memAllocInt(foo);
doSmthElse(barBuf);
barBuf.free();

From my understanding they are the same except the second one causes a memory leak in a case of exception.

Also is it a good idea to wrap native buffers in my class that on finalize makes sure that the free function is called on buffer?

 12 
 on: October 10, 2017, 21:36:04 
Started by MightyGarlic - Last post by MightyGarlic
Just downloaded the LWJGL library, and tried to import org.lwjgl.input.Keyboard; but it can't be resolved. Importing org.lwjgl.*, works totally fine


Can anyone help?

 13 
 on: October 08, 2017, 14:02:02 
Started by bluenote10 - Last post by bluenote10
Cool thanks, your analysis was spot on: There was an issue with my runtime and I had to re-update to 1.18.

 14 
 on: October 08, 2017, 13:31:23 
Started by bluenote10 - Last post by spasi
ovrError_LibSymbols is returned by ovr_Initialize when a function pointer could not be loaded from the runtime shared library. I don't have Oculus hardware, but for me it works without errors.

Sounds like the Oculus runtime hasn't been properly updated to 1.18. If you just installed it, try restarting Windows.

 15 
 on: October 08, 2017, 11:09:49 
Started by bluenote10 - Last post by bluenote10
After a long break, I'm migrating a VR application from libovr 1.3 to 1.18 (i.e. going from lwjgl 3.0.0 build 65 to the latest 3.1.3 release).

Even after upgrading the Oculus runtime to the latest version, the code was still working with libovr 1.3. After the migration, the programs fails early in ovr_Initialize with an error code of -3023, which according to the headers is the enum value of ovrError_LibSymbols and means "LibOVRRT symbol resolution failure" (link1 link2). According to the logs, the DLLs are properly extracted and loaded:

Code: [Select]
main                      [DEBUG] OvrWrapperWin$       |  *** Initializing LibOVR
[LWJGL] Version: 3.1.3 SNAPSHOT
[LWJGL]          OS: Windows 7 v6.1
[LWJGL]         JRE: 1.8.0_77 amd64
[LWJGL]         JVM: Java HotSpot(TM) 64-Bit Server VM v25.77-b03 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL]         Found at: C:\Users\Fabian\AppData\Local\Temp\lwjglFabian\3.1.3-SNAPSHOT\lwjgl.dll
[LWJGL]         Loaded from org.lwjgl.librarypath: C:\Users\Fabian\AppData\Local\Temp\lwjglFabian\3.1.3-SNAPSHOT\lwjgl.dll
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] MemoryUtil allocator: StdlibAllocator
[LWJGL] Loading library (system): lwjgl_ovr
[LWJGL]         Found at: C:\Users\Fabian\AppData\Local\Temp\lwjglFabian\3.1.3-SNAPSHOT\lwjgl_ovr.dll
[LWJGL]         Loaded from org.lwjgl.librarypath: C:\Users\Fabian\AppData\Local\Temp\lwjglFabian\3.1.3-SNAPSHOT\lwjgl_ovr.dll
main                      [DEBUG] OvrWrapperWin$       | ovr_Initialize = -3023

I have checked that the extracted DLLs exist and they look fine.

Any ideas what could be causing this?

 16 
 on: October 07, 2017, 19:09:24 
Started by Screendead - Last post by KaiHH
You are not new to LWJGL, you are new to OpenGL.

Like BDL on Stackoverflow told you, you should look for tutorials.
In case you searched for tutorials/articles/videos about LWJGL, don't do this. Instead, look for tutorials about OpenGL.
You will have to get comfortable reading C/C++ code for that, since all good OpenGL tutorials use C/C++ in code examples.
Just google for "OpenGL tutorial" and work your way through the links on the first result page.

Lastly: OpenGL is one of the most complex/complicated/very-hard-to-learn APIs in the world. And it is veeery old (21 years) and changed a lot in this time. Nothing you'll find will be "the definitive way of doing things". There are lots of ways to do anything in OpenGL, partly because hardware evolved heavily over the last two decades and the API had to account for that. You gonna have to have a lot of patience and learn through many many maaany tutorials and small toy projects. At some point, you even need to look up the OpenGL Specification. It'll obviously contain the most detailed and exact information about everything.

 17 
 on: October 07, 2017, 17:44:26 
Started by Screendead - Last post by Screendead
Okay, now it actually draws something, which is good.
I don't understand why it messes up the textures?
And I'm sorry, but I used GLUtil.setupDebugMessageCallback() and it gives me several errors:
Code: [Select]
[LWJGL] OpenGL debug message
ID: 0x502
Source: API
Type: ERROR
Severity: HIGH
Message: GL_INVALID_OPERATION error generated. No active program.
[LWJGL] OpenGL debug message
ID: 0x20071
Source: API
Type: OTHER
Severity: NOTIFICATION
Message: Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
[LWJGL] OpenGL debug message
ID: 0x20071
Source: API
Type: OTHER
Severity: NOTIFICATION
Message: Buffer detailed info: Buffer object 2 (bound to GL_ELEMENT_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
[LWJGL] OpenGL debug message
ID: 0x20071
Source: API
Type: OTHER
Severity: NOTIFICATION
Message: Buffer detailed info: Buffer object 3 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.
[LWJGL] OpenGL debug message
ID: 0x20071
Source: API
Type: OTHER
Severity: NOTIFICATION
Message: Buffer detailed info: Buffer object 4 (bound to GL_ELEMENT_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.

As I am new to LWJGL, I have been following several tutorials online, all of which seem to do different things, so I don't understand your three points. Could you please clarify why those things are bad practice?
I've included the complete source code and resources for my project.

 18 
 on: October 07, 2017, 12:23:06 
Started by Screendead - Last post by spasi
The MasterRenderer::render method looks very wrong:

- You're mixing generic vertex attributes (glVertexAttrib) with fixed-function attributes (glVertex, glTexCoord). You should use one or the other, depending on what your vertex shader accesses.
- You're trying to bind the GL_ELEMENT_ARRAY_BUFFER to vertex attrib 1? Vertex attributes are for data, not indices.
- You're unbinding the GL_ELEMENT_ARRAY_BUFFER_ARB before the glDrawElements call.

I recommend setting up a GL error callback (you can use GLUtil.setupDebugMessageCallback()) and if that doesn't help, use the LWJGLX/debug agent.

 19 
 on: October 07, 2017, 00:45:20 
Started by Screendead - Last post by Screendead
I'm pretty new to LWJGL, and I realise I'm biting off a huge chunk very quickly, but please be patient.
I'm trying to render a quad to the window (just one for now, but eventually I'll be displaying many), and I get a nasty error from the JRE:
Code: [Select]
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000689d4750, pid=8696, tid=0x0000000000001e8c
#
# JRE version: Java(TM) SE Runtime Environment (8.0_144-b01) (build 1.8.0_144-b01)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.144-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [nvoglv64.DLL+0x814750]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# F:\Eclipse Projects\Deserted\hs_err_pid8696.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
The full error log is attached.

I have also attached a .zip file with all of the source code for the project in it.
Any help would be greatly appreciated.
Thanks!

 20 
 on: October 06, 2017, 05:12:47 
Started by matan45 - Last post by matan45
is not fixing it

Pages: 1 [2] 3 4 ... 10