c - error creating shader type 35663 -


i want learn opengl , follow tutorial in http://ogldev.atspace.co.uk/ nicely tutorial 1,2 have been passed. on tutorial 3,that make triangle got error. code compile run error creating shader type. , know maybe because use windows. can me ? or can give me website develop opengl in windows?

this code

     /*     tutorial 03 - first triangle     */

#include <stdio.h> #include <gl/glew.h> #include <gl/freeglut.h> #include "math_3d.h" 

gluint vbo;

static void renderscenecb() { glclear(gl_color_buffer_bit); glenablevertexattribarray(0); glbindbuffer(gl_array_buffer, vbo); glvertexattribpointer(0, 3, gl_float, gl_false, 0, 0); gldrawarrays(gl_triangles, 0, 3); gldisablevertexattribarray(0); glutswapbuffers(); } static void initializeglutcallbacks() { glutdisplayfunc(renderscenecb); } static void createvertexbuffer() { vector3f vertices[3]; vertices[0] = vector3f(-1.0f, -1.0f, 0.0f); vertices[1] = vector3f(1.0f, -1.0f, 0.0f); vertices[2] = vector3f(0.0f, 1.0f, 0.0f); glgenbuffers(1, &vbo); glbindbuffer(gl_array_buffer, vbo); glbufferdata(gl_array_buffer, sizeof(vertices), vertices, gl_static_draw); } int main(int argc, char** argv) { glutinit(&argc, argv); glutinitdisplaymode(glut_double|glut_rgba); glutinitwindowsize(1024, 768); glutinitwindowposition(100, 100); glutcreatewindow("tutorial 03"); initializeglutcallbacks(); // must done after glut initialized! glenum res = glewinit(); if (res != glew_ok) { fprintf(stderr, "error: '%s'\n", glewgeterrorstring(res)); return 1; } glclearcolor(0.0f, 0.0f, 0.0f, 0.0f); createvertexbuffer(); glutmainloop(); return 0; }

in addition error msg,thx @kilon remind me ,so sorry can't upload directly picture of error msg in pc. here

error msg

if use .vsh , .fsh files, try add project:

go project -> targets -> build phases -> copy bundle recourses 

and add 2 files.

hope help.

upd: work mac os (xcode).


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -