c# - SharpGL: Setting the version to 4.0 or a replacement for GLEW -


currently i'm stuck making c#-wpf-opengl application. followed http://www.codeproject.com/articles/265903/using-opengl-in-a-wpf-application tutorial , able run sample project. however, first call function that's not part of opengl 1.1.0 fails, i.e code looks this

private void openglcontrol_openglinitialized(object sender, opengleventargs args) { opengl gl = args.opengl;  gluint glerror; while ( (glerror = gl.geterror()) != opengl.gl_no_error ) {     console.writeline( gl.geterrordescription(glerror) ); }  console.writeline( gl.getstring(opengl.version) ); //prints out 1.1.0  gluint hvertexshader; hvertexshader = gl.createshader(opengl.gl_vertex_shader);//compiles, raises exception, gl.createprogramm() or other functions    } 

somehow link https://github.com/dwmkerr/sharpgl/wiki/specifying-opengl-version can't me set version 4.2. how can achieve that?

solved! missing renderingcontext="fbo" in mainwindow.xaml, so

<sharpgl:openglcontrol          name="openglcontrol"          opengldraw="openglcontrol_opengldraw"         openglinitialized="openglcontrol_openglinitialized"          resized="openglcontrol_resized"         keydown="onkeydownhandler"         mouse.mousewheel="mousewheeleventhandler"         drawfps="true" rendercontexttype="fbo" framerate="20"/> 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -