a follow to: opengl4net wm_paint not exist?
i still closely following: https://sourceforge.net/p/ogl4net/wiki/tutorials
the program stands:
using system; using system.collections.generic; using system.threading.tasks; using system.windows.forms; using opengl4net; namespace pads2 { class program : form { private const int wm_paint = 15; renderingcontext rc; static void main(string[] args) { program program = new program(); program.init(); application.run(program); } // required open gl void init() { rc = renderingcontext.createcontext(this); setstyle(controlstyles.allpaintinginwmpaint, true); } void render() { gl.clear(gl.color_buffer_bit); // here right place draw scene rc.swapbuffers(); } // change window size protected override void onsizechanged(eventargs e) { gl.viewport(0, 0, clientsize.width, clientsize.height); // projection matrix may need adjusting } // required open gl protected override void wndproc(ref message m) { switch (m.msg) { case wm_paint: render(); break; default: base.wndproc(ref m); break; } } } }
q: provided i'm implementing tutorial correctly, can error system.badimageformatexception
on line program.init();
?
additionally:
additional information: not load file or assembly 'opengl4net, version=4.3.37.24, culture=neutral, publickeytoken=null' or 1 of dependencies. attempt made load program incorrect format.
this due warning:
there mismatch between processor architecture of project being built "msil" , processor architecture of reference "opengl4net", "amd64". mismatch may cause runtime failures. please consider changing targeted processor architecture of project through configuration manager align processor architectures between project , references, or take dependency on references processor architecture matches targeted processor architecture of project.
however according to:
how fix visual studio compile error, "mismatch between processor architecture"?
this should not issue. there option of (32 or 64) bit when downloading opengl4net dll.
given microsoft intermediate language not same processor, tried running in release mode instead of debug mode, makes no difference.
what build configuration use when compiling? , version of opengl4net did download? 32 or 64 bit version?
try setting build configuration match intended target cpu of referenced assembly (so, either 32 or 64 bit, depending on download of opengl4net).
see c# compiling 32/64 bit, or cpu? detailed explanation.
Comments
Post a Comment