Skip to content

Commit

Permalink
Lower GLSL version requirement
Browse files Browse the repository at this point in the history
I didn't really use any of the newer features anyway.
This should accomodate open source drivers that use older versions of MESA.
  • Loading branch information
Bigpet committed Aug 13, 2015
1 parent 9361573 commit f0b87c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/itdelatrisu/opsu/objects/curves/Curve.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ public static void init(int width, int height, float circleSize, Color borderCol
Curve.borderColor = borderColor;

ContextCapabilities capabilities = GLContext.getCapabilities();
mmsliderSupported = capabilities.GL_EXT_framebuffer_object && capabilities.OpenGL33;
mmsliderSupported = capabilities.GL_EXT_framebuffer_object && capabilities.OpenGL30;
if (mmsliderSupported)
CurveRenderState.init(width, height, circleSize);
else {
if (Options.getSkin().getSliderStyle() != Skin.STYLE_PEPPYSLIDER)
Log.warn("New slider style requires FBO support and OpenGL 3.2.");
Log.warn("New slider style requires FBO support and OpenGL 3.0.");
}
}

Expand Down
11 changes: 6 additions & 5 deletions src/itdelatrisu/opsu/render/CurveRenderState.java
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ public void initShaderProgram() {
program = GL20.glCreateProgram();
int vtxShdr = GL20.glCreateShader(GL20.GL_VERTEX_SHADER);
int frgShdr = GL20.glCreateShader(GL20.GL_FRAGMENT_SHADER);
GL20.glShaderSource(vtxShdr, "#version 330\n"
GL20.glShaderSource(vtxShdr, "#version 130\n"
+ "\n"
+ "layout(location = 0) in vec4 in_position;\n"
+ "layout(location = 1) in vec2 in_tex_coord;\n"
+ "in vec4 in_position;\n"
+ "in vec2 in_tex_coord;\n"
+ "\n"
+ "out vec2 tex_coord;\n"
+ "void main()\n"
Expand All @@ -426,15 +426,15 @@ public void initShaderProgram() {
String error = GL20.glGetShaderInfoLog(vtxShdr, 1024);
Log.error("Vertex Shader compilation failed.", new Exception(error));
}
GL20.glShaderSource(frgShdr, "#version 330\n"
GL20.glShaderSource(frgShdr, "#version 130\n"
+ "\n"
+ "uniform sampler1D tex;\n"
+ "uniform vec2 tex_size;\n"
+ "uniform vec3 col_tint;\n"
+ "uniform vec4 col_border;\n"
+ "\n"
+ "in vec2 tex_coord;\n"
+ "layout(location = 0) out vec4 out_colour;\n"
+ "out vec4 out_colour;\n"
+ "\n"
+ "void main()\n"
+ "{\n"
Expand All @@ -451,6 +451,7 @@ public void initShaderProgram() {
}
GL20.glAttachShader(program, vtxShdr);
GL20.glAttachShader(program, frgShdr);
GL30.glBindFragDataLocation(program, 0, "out_colour");
GL20.glLinkProgram(program);
res = GL20.glGetProgrami(program, GL20.GL_LINK_STATUS);
if (res != GL11.GL_TRUE) {
Expand Down

0 comments on commit f0b87c9

Please sign in to comment.