Hello Guest

Recent Posts

Pages: [1] 2 3 ... 10
1
Lightweight Java Gaming Library / Re: Linux 32bit support how can I do it?
« Last post by Andrew Alfazy on September 18, 2018, 18:19:54 »
UPDATE : for anyone find this topic (googling or any way),
LWJGL for linux 32bit  Is not supported anymore even all over the Internet (Eclipse IDE , discord , Java 9 +, Ubuntu 18.04+,etc ) :-\; so try to get yourself 64-bit CPU :P

Sorry for my bad English
2
OpenGL / Re: Function already has a body: main
« Last post by Pito on September 17, 2018, 11:09:05 »
You likely created both shader objects with glCreateShader using GL_VERTEX_SHADER. You have to create the fragment shader using glCreateShader(GL_FRAGMENT_SHADER). Otherwise the linker will assume that both vertex shader objects need to be linked together to form the vertex shader stage.

omg ... I am so stupid xD thanks a lot
3
OpenGL / Re: Function already has a body: main
« Last post by KaiHH on September 17, 2018, 10:16:36 »
You likely created both shader objects with glCreateShader using GL_VERTEX_SHADER. You have to create the fragment shader using glCreateShader(GL_FRAGMENT_SHADER). Otherwise the linker will assume that both vertex shader objects need to be linked together to form the vertex shader stage.
4
OpenGL / Function already has a body: main
« Last post by Pito on September 17, 2018, 10:00:50 »
Hi guys
I have a small problem :smiley:
"Vertex shader(s) failed to link.
Vertex link error: INVALID_OPERATION.
ERROR: 0:4: error(#248) Function already has a body: main
ERROR: error(#273) 1 compilation errors.  No code generated"

I am trying to do what I learn in cpp into Java using LWJGL ( OpenGL wrapper) But After checking 10000 times I see no reasons why it wouldn't work, giving me this errors :

Code: [Select]
Vertex shader(s) failed to link.
Vertex link error: INVALID_OPERATION.
ERROR: 0:4: error(#248) Function already has a body: main
ERROR: error(#273) 1 compilation errors.  No code generated

The thing is
my shaders are pretty simple.

Vertex Shader :
Code: [Select]
#version 330 core
layout (location = 0) in vec3 aPos;

void main()
{
    gl_Position = vec4(aPos, 1.0);
}

Fragment Shader :
Code: [Select]
#version 330 core
out vec4 FragColor;

void main()
{
    FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f);
}

No syntax error either
The source in the linking is correct too
someone has an idea? It's like they say I shouldn't have 2 Main with those 2 shaders lol

Thank you for your help.
5
General Java Game Development / Problem with scaling of textures in 2d
« Last post by kullboys on September 15, 2018, 07:41:37 »
Hello everyone
I wanted to start programming a 2d game, that is tile-based. The tiles are arranged in tile-sets (png-files). I seperate them in code, which seems to work just fine. but to look it more retro, i wanted to upscale the tiles from 16x16 to 32x32 at runtime.
I managed to scale them up, but there is some strange bright line between the tiles, but only horizontally. The line is not one-colore, it looks to me that this is some kind of interpolation issue at the edges.
Can you explain this, and if my guess is right, can I change the way, pictures are scaled?

Thank you very much in advance.
6
OpenGL / Re: Element exceeds maximum supported number of combined texture image units
« Last post by Danjb on September 14, 2018, 19:38:27 »
Thank you so much, that was really helpful.

The problem was that I was doing this:

Code: [Select]
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureId);
glUniform1i(uniformLoc, GL_TEXTURE0);

Instead of this:

Code: [Select]
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureId);
glUniform1i(uniformLoc, 0);

GL_TEXTURE0 has the value 33984, whereas samplers have to have a value in the value [0, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS).
(Source: https://www.khronos.org/opengl/wiki/Texture#Samplers)

Thanks again.
Dan
7
LWJGL Documentation / Re: LWJGL Alert function
« Last post by spasi on September 14, 2018, 19:33:40 »
The tiny file dialogs bindings (tinyfd module in LWJGL) should have everything you need.
8
LWJGL Documentation / Re: LWJGL Alert function
« Last post by KaiHH on September 14, 2018, 18:23:50 »
LWJGL3 has bindings for https://github.com/mlabbe/nativefiledialog
You can download a bundle of LWJGL3 containing nfd using: https://www.lwjgl.org/customize


Nevermind: I just realized it only covers file open dialogs and no message dialogs...
9
LWJGL Documentation / LWJGL Alert function
« Last post by Xydez on September 14, 2018, 18:19:12 »
Hey! Since the Sys class was removed in LWJGL 3, how do I send alerts to the user?
10
OpenGL / Re: Element exceeds maximum supported number of combined texture image units
« Last post by KaiHH on September 14, 2018, 17:54:02 »
The first step is to identify, which GL call caused this error. If you are using LWJGL 3, then the easiest way is to start your JVM with the LWJGLX/debug agent: https://github.com/LWJGLX/debug
You can download it directly from here: https://build.lwjgl.org/addons/lwjglx-debug/lwjglx-debug-1.0.0.jar
Then start the JVM with the JVM argument -javaagent:/path/to/lwjglx-debug-1.0.0.jar and you should see a stack trace when you hit the error.
Pages: [1] 2 3 ... 10