D
D
Dmitry Kharitonov2014-02-01 03:12:22
OpenGL
Dmitry Kharitonov, 2014-02-01 03:12:22

OpenGL 2.1, Mac OS X 10.9 and layout in GLSL?

Hello. I encountered such a problem that on Mac OS X 10.9 you can only use the ancient version of GLSL 1.2, which, as far as I understand, does not support the construction of the form "layout (location = 0) in vec3 position;". Is there some equivalent, or maybe I'm doing something wrong? Shader code:

#version 120

layout (location = 0) in vec3 position;

void main() {
    gl_Position = vec4(0.25 * position, 1.0);
}

to which I get the error "ERROR: 0:3: 'layout' : syntax error syntax error"
OpenGL Version: 2.1 ATI-1.14.21
GLSL: 1.20

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kharitonov, 2014-02-01
@geakstr

The solution to the problem is to manually set the context.

...
PixelFormat pixelFormat = new PixelFormat();
ContextAttribs contextAtrributes = new ContextAttribs(3, 2).withForwardCompatible(true).withProfileCore(true);
Display.create(pixelFormat, contextAtrributes);
...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question