i'm trying opengl4net working c# in microsoft visual studio comunity 2015.
i've downloaded file: https://sourceforge.net/projects/ogl4net/files/rev.%2037/x64/
and followed these instructions: https://sourceforge.net/p/ogl4net/wiki/tutorials/
at first console application starting again windows form application seems if going using window opposed making own.
so far various refrances have been added, form1.cs untouched , program.cs looks this:
using system; using system.collections.generic; //using system.linq; using system.threading.tasks; using system.windows.forms; using opengl4net; namespace pads2 { class program : form { 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 windows.wm_paint: render(); break; default: base.wndproc(ref m); break; } } } } /* static class program { /// <summary> /// main entry point application. /// </summary> [stathread] static void main() { application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); application.run(new form1()); } } /*
the compiler seems unhappy comment @ end of code, main issue recieve error:
the type or namespace name 'wm_paint' not exist in namespace 'windows' (are missing assembly reference?)
i've been unable find reference need wm_paint online, including reference system.windows did not help.
q: how can solve , setting correctly?
wm_paint
described in detail in msdn entry:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd145213(v=vs.85).aspx
the article omits pod value, being integer constant "15".
Comments
Post a Comment