Library tutorials & articles
OpenGL and C# - Part 1
Summary
You now know how to set up a OpenGL form where you can draw. But for now play with this and I will come soon with my next article about OpenGL.
BTW: there is one thing I want to tell you and that is that you can put as
many glColor3f() functions between the glVertex3f() so
that all points get different colors really cool!!!
As you may notice we didn’t covered any basics for coordinates and this
will be my next article to really draw some figures and so.
Related articles
Related discussion
-
OpenGL and C# - Part 1
by wuseltum (7 replies)
-
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
by virtualking (0 replies)
-
How to optimize mysql subquery performance?
by Jayaram P (0 replies)
-
C# video Editing/rendering
by pkuchaliya (0 replies)
-
How to Fill DataSet with more records (around 1 lakh) in a faster way
by Jayaram P (0 replies)
Related podcasts
-
Object-Oriented Programming in Ruby
In this episode, I talk with Scott Bellware about object-oriented programming in Ruby, and Ruby's object model. This is taken from a private conversation, and the audio quality suffers at times. Much thanks to Scott for allowing this to be released.This episode of the Alt.NET Podcast is bro...
Thanks for the tutorial, unfortunately it does not work for me. All I see is white background with a red cross of which I don't know where it comes from... Thanks for any help...
!--removed tag-->Strange, I've added a menu in the top of the window and now everything works perfectly :) thx for the tutorial. Without it I would never start. We Polish used to say "The first step is the hardest"
!--removed tag-->First of all there is no csgl-base.dll in a package csgl.dll.zip downloaded from project site. Secound of all can anybody tell me why it doesn't work? Sometimes I have to change widnow size to see the scene, sometimes it never showes up :| why? What I'm doing wrong? uffff F1 F1 F1 HELP!
!--removed tag-->the solution i know is:
which is simpler
!--removed tag-->the solution i know is:
which is simpler
!--removed tag-->private void OpenGL_Start() { if( this.view.InvokeRequired) { ThreadStart aDelegate = new ThreadStart(this.view.Refresh); for( ; ; ) { Thread.Sleep(1000); if( !thrOpenGL.IsAlive ) return; this.Invoke(aDelegate); } } else { for( ; ; ) { // infinity loop for rendering Thread.Sleep(1000); this.view.Refresh(); } } }
!--removed tag-->(sorry for not marking the code as code in the comment above...)
Hi Johnny, Still there? I know it's been a while since 2003... But if you are still around, or anyone else, I have a question:
How do I draw two separate sets of drawing in parallel? I want to draw an Anaglyph. Let's say, a blue cube and a red cude. each in a different color and at a slightly different angle acording to two POV (points of view).
Any suggestions?
All the best. Amir
!--removed tag-->Hi All, I ran into some trouble with the thread above, but, I found a solution... Aperantly, while using Visual Studio 2008 such a cross thread action is considered unsafe. Anyway, the "Invoke" method can take care of that with just a few lines of code:
private void OpenGL_Start() { if( this.view.InvokeRequired) { ThreadStart aDelegate = new ThreadStart(this.view.Refresh); for( ; ; ) { Thread.Sleep(1000); if( !thrOpenGL.IsAlive ) return; this.Invoke(aDelegate); } } else { for( ; ; ) { // infinity loop for rendering Thread.Sleep(1000); this.view.Refresh(); } } }
The 'if' statement check to see if the action is done on the current thread or not and uses the "invoke" when necessary.
I hope I saved someone the 60 minutes it took me... ;-)
!--removed tag-->