LWJGL 3 rendering issues

I’m probably being an absolute idiot here ( as usual ) , i’m trying to render a simple shape in my new graphics engine and while the window is shown no image is shown on the screen. Below is the relative code.



public void render() {
		GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
		int index = 0;
		for(index = 0; index < buffer_objects.size();index++){
			BufferObject render_object = buffer_objects.get(index);
			vbo_core.bind_shader();
			GL11.glEnable(GL11.GL_BLEND);
			GL11.glBindTexture(GL11.GL_TEXTURE_2D, render_object.texture.id);
			GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, render_object.vertex_id);
			GL20.glEnableVertexAttribArray(vbo_core.locationattribvertex);
			GL20.glEnableVertexAttribArray(vbo_core.locationattribtex);
			GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER,render_object.vertex_id);
			GL20.glVertexAttribPointer(vbo_core.locationattribvertex, 2,
					GL11.GL_FLOAT, false, 0, 0);
			GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, render_object.texture_id);
			GL20.glVertexAttribPointer(vbo_core.locationattribtex, 2,
					GL11.GL_FLOAT, false, 0, 0);
			// Draw the textured rectangle
			GL20.glUniform2f(vbo_core.locationdimension, width, height);
			GL20.glUniform2f(vbo_core.locationtransform, render_object.translation.x,
					render_object.translation.y);
			GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, render_object.vert_count);
			
			GL20.glDisableVertexAttribArray(vbo_core.locationattribvertex);
			GL20.glDisableVertexAttribArray(vbo_core.locationattribtex);

			GL11.glEnable(GL11.GL_BLEND);
			vbo_core.un_bind_shader();
		}
		
	}




public int create_buffer(int size , Vertex2d[] data,Texture t){
		int index = create_buffer(size,t);
		BufferObject buffer = buffer_objects.get(index);
		for(Vertex2d vertex :data){
			buffer.verticies.put(vertex.x);
			buffer.textures.put(vertex.u);
			buffer.verticies.put(vertex.y);
			buffer.textures.put(vertex.v);
			buffer.vert_count+=2;
		}
		buffer_objects.set(index,buffer);
		buffer.flip();
		GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, buffer.vertex_id);
		GL15.glBufferData(GL15.GL_ARRAY_BUFFER, buffer.verticies, GL15.GL_STREAM_DRAW);
		GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, buffer.texture_id);
		GL15.glBufferData(GL15.GL_ARRAY_BUFFER,	buffer.textures, GL15.GL_STREAM_DRAW);
		GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
		return index;
	}


Any help an obvious error pointing out would be helpful.

what happens if you render untextured ?

I am forcibly setting the colour of the shape within my frag shader. Here they are.
vertex




attribute vec2 position;
attribute vec2 texin;
uniform vec2 transform;
uniform vec2 dimension;
vec2 convertback(vec2 data){
float tx = data.x * dimension.x;
float ty = data.y * dimension.y;
vec2 stage1 = vec2(tx,ty);
tx = stage1.x + dimension.x;
ty = stage1.y + dimension.y;
return vec2(tx,ty);
}
vec2 convertto(vec2 data){
float tx = data.x ;
float ty = data.y;
vec2 stage1 = vec2(tx - dimension.x,ty - dimension.y);
vec2 stage2 = vec2((stage1.x )/dimension.x,(stage1.y )/dimension.y);
return stage2;
}
void main(){
   
   vec4 offset = vec4((position.x+transform.x),(position.y+transform.y),1,1);
   gl_Position = offset;


}


frag



uniform sampler2D bgl_RenderedTexture;

void main(){
	vec4 tex = texture2D(bgl_RenderedTexture,vecdata);
    if(tex.rgb == vec3(1.0,0,1.0)){
         discard;
    }
    else{
    gl_FragColor = vec4(1.0,0,1.0,1);
    }
    
    
  }
    
   


I’ll show the GLFW init code along with the full render code.

public void create_display(int width, int height, String name, int framerate) {

		GLFW.glfwInit();
		core.window = GLFW.glfwCreateWindow(width, height,
				name, 0, 0);
		this.width = width;
		this.height = height;
		GLFW.glfwMakeContextCurrent(core.window);
		GLFW.glfwSwapInterval(1);
		GLFW.glfwShowWindow(core.window);
		GL.createCapabilities();
		vbo_core = new CoreVBO();
		GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
		GL11.glEnable(GL11.GL_BLEND);
		GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

	}

public void render() {
		core.graphics.render();
		for(int i = 0; i < render_methods.size();i++){//manual rendering , must be done through the graphics handler
			render_methods.get(i).call();
		}
	}

Discovered I hadn’t enabled the GLFW contexts , seems to have fixed it. Thanks SHC for the tutorial.