using opengl in c n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Using OpenGL in C# PowerPoint Presentation
Download Presentation
Using OpenGL in C#

Loading in 2 Seconds...

play fullscreen
1 / 6

Using OpenGL in C# - PowerPoint PPT Presentation


  • 213 Views
  • Uploaded on

Using OpenGL in C#. by Joshua Shelfer. Setting It Up. www.taoframework.com Install the Setup file Or Download the Zip file Open lib\win32deps and copy freeglut.dll Paste freeglut.dll into WINDOWS\System. Getting Started. Open your .NET solution Click Project > Add Reference

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Using OpenGL in C#' - dulcinea


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
using opengl in c

Using OpenGL in C#

by Joshua Shelfer

setting it up
Setting It Up
  • www.taoframework.com
  • Install the Setup file
    • Or
  • Download the Zip file
    • Open lib\win32deps and copy freeglut.dll
    • Paste freeglut.dll into WINDOWS\System
getting started
Getting Started
  • Open your .NET solution
    • Click Project > Add Reference
    • If you installed, find the three Tao GL and GLUT files under .NET tab
    • If not, find these dlls under the browse tab (located in the bin folder of the Zip file). Keep in mind, the dlls will have to be in the same directory as the Exe file in order for it to run.
      • Tao.Freeglut.dll
      • Tao.OpenGL.dll
      • Tao.OpenGL.Glu.dll
required code
Required Code
  • Add these lines of code
    • using Tao.FreeGlut;
    • using Tao.OpenGl;
example code
Example Code

Main function

Glut.glutInit();

Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB);

Glut.glutInitWindowSize(INITIAL_WIDTH, INITIAL_HEIGHT);

Glut.glutInitWindowPosition(0, 0);

Glut.glutCreateWindow("Tic Tac Toe");

Glut.glutDisplayFunc(tictactoe.display);

Glut.glutMouseFunc(tictactoe.mouseHandler);

Glut.glutMotionFunc(tictactoe.motionHandler);

Glut.glutReshapeFunc(tictactoe.reshapeHandler);

Init function

Gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);

Gl.glColor3f(0.0f, 0.0f, 0.0f);

Gl.glMatrixMode(Gl.GL_PROJECTION);

Gl.glLoadIdentity();

Glu.gluOrtho2D(0.0, 50.0, 0.0, 50.0);

Gl.glMatrixMode(Gl.GL_MODELVIEW);

pros and cons
Pros and Cons
  • Pros:
    • Inherent benefits of C#
    • OOP
    • Easy to set up
  • Cons:
    • Gl., Glut., And Glu. can be cumbersome to type
    • User must have freeglut.dll in WINDOWS\System folder