Triangle will not render (Justin Agrell)

You were both right, I was not specifying shaders at all. I decided to
find another example source and modify it to get things working for my
setup.

(Original source from:
http://www.brandonfoltz.com/2013/12/example-using-opengl-3-0-with-sdl2-and-glew/)

(my modified source)
http://u4e.us/c/main.c
http://u4e.us/c/fs1.glsl
http://u4e.us/c/vs1.glsl

This one renders the triangle finally!

I could not get the triangle to render color-per-vertex like in the
example so I removed it. I’m thinking that it didn’t work due to my old
laptop (Intel 3000 graphics/GL 3.1) more than the source itself.

Thanks again!

I’m glad they were able to help you.

I’ll just point out that OpenGL 3.1 is not very old (though the Intel HD
3000’s performance is lacking). You would only need newer GL versions for
certain features, like on-GPU tessellation. Per-vertex colors can be done
with shaders on OpenGL 1.5, so you’re certainly fine!

Jonny DOn Thu, Sep 18, 2014 at 5:23 PM, Justin Agrell wrote:

You were both right, I was not specifying shaders at all. I decided to
find another example source and modify it to get things working for my
setup.

(Original source from:

http://www.brandonfoltz.com/2013/12/example-using-opengl-3-0-with-sdl2-and-glew/
)

(my modified source)
http://u4e.us/c/main.c
http://u4e.us/c/fs1.glsl
http://u4e.us/c/vs1.glsl

This one renders the triangle finally!

I could not get the triangle to render color-per-vertex like in the
example so I removed it. I’m thinking that it didn’t work due to my old
laptop (Intel 3000 graphics/GL 3.1) more than the source itself.

Thanks again!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yeah but it’s always good when people start off on the modern core context
right away, so they don’t have to needlessly relearn things when they
switch to ES. Not using outdated legacy GL is never a bad idea.

2014-09-19 3:31 GMT+02:00 Jonathan Dearborn :> I’m glad they were able to help you.

I’ll just point out that OpenGL 3.1 is not very old (though the Intel HD
3000’s performance is lacking). You would only need newer GL versions for
certain features, like on-GPU tessellation. Per-vertex colors can be done
with shaders on OpenGL 1.5, so you’re certainly fine!

Jonny D

On Thu, Sep 18, 2014 at 5:23 PM, Justin Agrell wrote:

You were both right, I was not specifying shaders at all. I decided to
find another example source and modify it to get things working for my
setup.

(Original source from:

http://www.brandonfoltz.com/2013/12/example-using-opengl-3-0-with-sdl2-and-glew/
)

(my modified source)
http://u4e.us/c/main.c
http://u4e.us/c/fs1.glsl
http://u4e.us/c/vs1.glsl

This one renders the triangle finally!

I could not get the triangle to render color-per-vertex like in the
example so I removed it. I’m thinking that it didn’t work due to my old
laptop (Intel 3000 graphics/GL 3.1) more than the source itself.

Thanks again!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org