Main Menu

Recent posts

#61
Vulkan / following the pNext chain
Last post by sgold - August 23, 2023, 08:42:30
I want to check whether a Vulkan physical device supports triangle-fan topologies.
Triangle fans are in the Vulkan 1.0 spec, but apparently Molten is a "portability subset" that doesn't support them.
I use VK10.vkEnumerateDeviceExtensionProperties() to check whether the "VK_KHR_portability_subset" extension is available.
If it is, I use KHRGetPhysicalDeviceProperties2.vkGetPhysicalDeviceFeatures2KHR() to query device features.
I expect that somewhere in the pNext chain of the VkPhysicalDeviceFeatures2 there will be a Struct with stype=VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PORTABILITY_SUBSET_FEATURES_KHR.
How do I find it?
pNext() returns a handle to a Struct, but I don't know how to determine the type of the Struct.
Or am I going about this backward? Do I fill in the pNext() field myself, with the handle of the Struct I want vkGetPhysicalDeviceFeatures2KHR() to populate?
#62
The August release (v0.3.0) of Area Zero is available for download from www.ephemeraltechnicalarts.com! Try it out and provide feedback. You will also find how to play videos on the download page.
#63
Bug Reports / RFE / Re: libEGL.dll not found
Last post by Zegute - August 20, 2023, 06:33:24
It returns:
[LWJGL] Version: 3.3.0 build 21
[LWJGL]     OS: Windows Server 2022 v10.0
[LWJGL]    JRE: Windows amd64 17.0.7
[LWJGL]    JVM: OpenJDK 64-Bit Server VM v17.0.7+7 by Eclipse Adoptium
[LWJGL] Loading JNI library: lwjgl
[LWJGL]    Module: org.lwjgl
[LWJGL]    Using SharedLibraryLoader...
[LWJGL]    Found at: C:\Users\ADMINI~1\AppData\Local\Temp\lwjglAdministrator\3.3.0-build-21\lwjgl.dll
[LWJGL]    Loaded from org.lwjgl.librarypath: C:\Users\ADMINI~1\AppData\Local\Temp\lwjglAdministrator\3.3.0-build-21\lwjgl.dll
[LWJGL] Loading library: libEGL
[LWJGL]    Module: org.lwjgl.egl
[LWJGL]    libEGL.dll not found in org.lwjgl.librarypath=C:\Users\ADMINI~1\AppData\Local\Temp\lwjglAdministrator\3.3.0-build-21
[LWJGL]    libEGL.dll not found in system paths
[LWJGL]    libEGL.dll not found in java.library.path=D:\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.7.v20230425-1502\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.7.v20230425-1502/jre/bin/server;D:/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.7.v20230425-1502/jre/bin;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Program Files (x86)\Cuminas\Document Express DjVu Plug-in\;D:\graalvm-jdk-17.0.7+8.1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\ProgramData\chocolatey\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Common Files\GTK\2.0\bin;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Cloudflare\Cloudflare WARP\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;D:\TDM-GCC-64\bin;C:\Users\Administrator\AppData\Roaming\wix311-binaries;C:\Users\Administrator\AppData\Local\Programs\mongosh\;;D:\eclipse;;.
[LWJGL] Loading library: EGL
[LWJGL]    Module: org.lwjgl.egl
[LWJGL]    EGL.dll not found in org.lwjgl.librarypath=C:\Users\ADMINI~1\AppData\Local\Temp\lwjglAdministrator\3.3.0-build-21
[LWJGL]    EGL.dll not found in system paths
[LWJGL]    EGL.dll not found in java.library.path=D:\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.7.v20230425-1502\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.7.v20230425-1502/jre/bin/server;D:/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.7.v20230425-1502/jre/bin;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Program Files (x86)\Cuminas\Document Express DjVu Plug-in\;D:\graalvm-jdk-17.0.7+8.1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;C:\ProgramData\chocolatey\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Common Files\GTK\2.0\bin;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Cloudflare\Cloudflare WARP\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;D:\TDM-GCC-64\bin;C:\Users\Administrator\AppData\Roaming\wix311-binaries;C:\Users\Administrator\AppData\Local\Programs\mongosh\;;D:\eclipse;;.
[LWJGL] Failed to load a library. Possible solutions:
   a) Install the library or the driver that provides the library.
   b) Ensure that the library is accessible from the system library paths.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: libEGL.dll
   at org.lwjgl.system.Library.loadNative(Library.java:327)
   at org.lwjgl.system.Library.loadNative(Library.java:414)
   at org.lwjgl.system.Library.loadNative(Library.java:381)
   at org.lwjgl.egl.EGL.create(EGL.java:65)
   at org.lwjgl.egl.EGL.<clinit>(EGL.java:48)
   at org.lwjgl.egl.EGL10.eglSwapBuffers(EGL10.java:462)
   at org.hikagame.phantom.DisplayGLESImpl.swapBuffers(DisplayGLESImpl.java:97)
   at org.hikagame.phantom.Display.swapBuffers(Display.java:7)
   at org.hikagame.phantom.Main.main(Main.java:7)
#64
Bug Reports / RFE / libEGL.dll not found
Last post by Zegute - August 20, 2023, 06:10:25
I don't have any natives of egl
#65
Hi. sorry, I am a total newbie here; I was wondering why my code below works totally fine in my Eclipse Java project that uses JavaSE-1.8 but totally doesn't work in the project that uses JavaSE-17. I am totally lost here. it just said that the package is not accessible, I have been trying to find the answer anywhere on the internet and asking chat-gpt or bard doesn't produce any answer. Oh, and I use LWJGL 3.2.2 (I don't think it works with both versions of Java) and some random LWJGL folder I got from my university which I don't know the version (only works with JavaSE-1.8) Thank you in advance.



package Test;

import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import org.lwjgl.*;
import org.lwjgl.Sys;
import org.lwjgl.glfw.*;
import org.lwjgl.opengl.*;
import org.lwjgl.system.*;
import static org.lwjgl.glfw.Callbacks.*;
import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.opengl.GL30.*;
import static org.lwjgl.system.MemoryUtil.*;
import org.lwjgl.opengl.GLContext;

public class FirstOpenGLProgram 
{
	private static GLFWErrorCallback errorCallback;
	private static long mWindowId;
	private static float mClearColorRed = 0.1f;
	private static float mClearColorGreen = 0.7f;
	private static float mClearColorBlue = 1.0f;
	private static float mClearColorAlpha = 0.0f;
	private static String mWindowTitle = "First Program";
	private static int mWindowWidth = 400;
	private static int mWindowHeight = 300;
	
	public FirstOpenGLProgram()
	{
		System.out.println( "LWJGL version: " + Sys.getVersion() ); 
	}
	
	public void init()
	{
		// register method for error messages
		glfwSetErrorCallback(errorCallback = errorCallbackPrint(System.err));
		
		// Initialize glfw
		if (glfwInit() != GL_TRUE)
        {
            throw new IllegalStateException("Unable to initialize GLFW");
        }
		
		// Set up Window Hints
		glfwDefaultWindowHints(); 					// Load the default Window Hints
		
		glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); 	// The window will not be resizable
		glfwWindowHint(GLFW_VISIBLE, GL_FALSE);		// Window will not be visible initially
		
		// Get the size of the screen then calculate the centre.
		ByteBuffer vidmode = glfwGetVideoMode( glfwGetPrimaryMonitor() );
		
		int windowHorizOffset = (GLFWvidmode.width(vidmode)  - mWindowWidth)  / 2;
        int windowVertOffset  = (GLFWvidmode.height(vidmode) - mWindowHeight) / 2;
        
		// code to set full screen
        //mWindowWidth = GLFWvidmode.width(vidmode);
		//mWindowHeight = GLFWvidmode.height(vidmode);
        //mWindowId = glfwCreateWindow(GLFWvidmode.width(vidmode), GLFWvidmode.height(vidmode), "LWJGL3 - Coloured Triangle", glfwGetPrimaryMonitor(), NULL);
        
        // code for windowed window
        mWindowId = glfwCreateWindow(mWindowWidth, mWindowHeight, mWindowTitle, NULL, NULL);
        
        // set the windows position on the screen
        glfwSetWindowPos(mWindowId, windowHorizOffset, windowVertOffset);
        
        // Make the window visible
        glfwShowWindow(mWindowId);
        
		glfwMakeContextCurrent(mWindowId);			// Make the glfw context current
		
		GLContext.createFromCurrent();				// Generate an OpenGL context from the current glfw context
		
		// set the Clear colour
		glClearColor(mClearColorRed, mClearColorGreen, mClearColorBlue, mClearColorAlpha);		
	}
	public void mainLoop()
	{
		// Run the rendering loop until the user has attempted to close
        // the window or has pressed the ESCAPE key.
		while ( glfwWindowShouldClose(mWindowId) == GL_FALSE ){
			// Clear the frame buffer
			glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
			
			// Swap the color buffers  
			glfwSwapBuffers(mWindowId);
			
			// Poll for window events.
			glfwPollEvents();
		}
	}
	
	public void cleanUp()
	{
		// Destory the window created
		glfwDestroyWindow(mWindowId);
		
		// Release the error Call back
		errorCallback.release();
		
		// terminate the glfw context
		glfwTerminate();
	}
	
	public static void main(String[] args) 
	{
		
		// Create instance of our Lab
		FirstOpenGLProgram  lab = new FirstOpenGLProgram();
		
		try
        {        
			// Initialise the lab
			lab.init();
			
			// Run the main loop
			lab.mainLoop();
			
			// Clean up after our lab
			lab.cleanUp();
        }
        finally
        {
            // in case there was an exception terminate the GLFW context and release the call back function
            glfwTerminate();
            errorCallback.release();
        }
	}

}
#66
Lightweight Java Gaming Library / movable camera
Last post by notwhale - August 10, 2023, 08:10:05
how to move the camera or at least make it look like it's moving?
I've searched the internet, but nothing works for me.
#67
Hello. im using legacy LWJGL and i attempted to use wavedata.create(string) method But. it gived me worst error
heres a code.
public AudioBuffer(String file) {
        this.bufferId = alGenBuffers();
        WaveData wave = WaveData.create(file);
        alBufferData(bufferId, wave.format, wave.data, wave.samplerate);
        wave.dispose();
    }

heres a err.
java.lang.IllegalAccessError: class org.lwjgl.util.WaveData (in unnamed module @0xc8e4bb0) cannot access class com.sun.media.sound.WaveFileReader (in module java.desktop) because module java.desktop does not export com.sun.media.sound to unnamed module @0xc8e4bb0
how can i fix it?
#68
OpenGL / Re: Is OpenGL the right tool t...
Last post by bowen951209 - August 02, 2023, 13:09:23
    OpenGL is just an API which communicates with the GPU. The way programmers transfer 3D models to 2D is to use math. That is, OpenGL do most of the math in GPU, which is faster. But you can also do the math in CPU, that doesn't matter. But you can just search for OpenGL tutorials online, most posts will teach you about the computer graphics knowledge. It will take some time to learn. :)
    Of course you can render your scene headless. But I would recommend you to follow the online tutorial which would probably teach you how to render your scene in GLFW window. After you get familiar with OpenGL, there is a thing called "Texture".
    In OpenGL, your scene will be rendered on a framebuffer, and you can render the framebuffer to a specified texture. And for example, we can get the data back from the texture and transfer it to an image file. That should be what you want.
#69
OpenGL / How to handle non-English IME ...
Last post by bowen951209 - August 02, 2023, 12:55:56
    For example, I'm using Chinese IME. When I press a key, GLFW would not receive it. Instead, it popped up a small window displaying what character I typed. I want that when I press a key in Chinese IME, the small window wouldn't appear and I can send the key (and maybe translate it to an English character) to GLFW.
    I've seen a project which fulfill it in Minecraft. I want to know how it works and implement it in my Java/OpenGL program. Here is the picture of the small window(which I don't want).
#70
Lightweight Java Gaming Library / Issues while using custom/disa...
Last post by Jakes - August 01, 2023, 06:08:42
I'm currently having issues with the rendering canvas (repainting invocations) each time I change the cursor mode in any way, either by using glfwSetInputMode or Component.setCursor() or even glfwSetCursor.
Each time any cursor mode/type that isnt GLFW_CURSOR_NORMAL and Cursor.getDefaultCursor() the repaint of the Canvas gets called way less often while the mouse is moving across the surface of the canvas.
While the mouse is moving no rendering happens whatsoever.

I've tried to debug this, it seems to be comming from the event dispatcher.

My code structure:

RenderClass extends Canvas
- init: JAWT_GetDrawingSurface, JAWTWin32DrawingSurfaceInfo.create, glfwAttachWin32Window, glfwMakeContextCurrent, createCapabilities, 
- draw cycle: JAWT_DrawingSurface_Lock, <Render Code>, glfwSwapBuffers, glfwPollEvents, JAWT_DrawingSurface_FreeDrawingSurfaceInfo, JAWT_DrawingSurface_Unlock, [b]repaint[/b];


now, when I call any of these 2 lines of code:
canvas.setCursor(CURSOR_HIDDEN); -> set custom cursor to invisible one
glfwSetInputMode(Inputs.hwnd, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); -> hides the cursor


while moving the mouse the renderer stops from repainting, only to resume when no mouse is stopped, as you can see on the example:
https://i.imgur.com/GjWEyHl.mp4

Is there any known issue on this matter?

Note: This behaviour gets more noticeable when more hardware accelerated applications are running (like, google chrome with youtube, steam, video player, etc)

Regards