Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: OpenGL with C# ?

  1. #1
    Junior Member Newbie
    Join Date
    May 2002
    Location
    HCM
    Posts
    1

    OpenGL with C# ?

    I intend to write 1 simple OpenGL application in C# but I don’t know how to do this.
    Do you know how to write OpenGL by C# ?

    Hope to receive your reply.
    Thanks a lot.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: OpenGL with C# ?

    Hi !

    If memory serves me right, I belive I saw an article about OpenGL on C# at:
    http://www.codeguru.com

    (It may also have been www.codeproject.com)

    Mikael

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: OpenGL with C# ?

    I started to play with OpenGL in C# once. Mainly just to see if I could get it to work. I ran into problems where SetPixelFormat always seemed to fail, but it would return a success code and then wglCreateContext would fail. (I tried using GetPixelFormat after a supposedly succesful SetPixelFormat call and got the wrong answer.)

    I did find a library someone had written for doing OpenGL in C# and looked at his code. He actually had put his Choose/Describe/SetPixelformat stuff in a separate C dll, though. Make me think that there is some problem with the managed to unmanaged code in trying to call these functions.

    A quick search on Codeproject and Code guru didn't turn up much on OpenGL and C#, and Google pretty much just turns up the library I found. If anyone has a direct link to an example of using OpenGL directly in C# I'd be interested in seeing that as well.
    Deiussum
    Software Engineer and OpenGL enthusiast

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: OpenGL with C# ?


  5. #5
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: OpenGL with C# ?

    Thanks. That project also appears to use C/C++ to create it's own DLL for the OpenGL initialization. The C# project then calls into that. It appears you probably can't do what I was hoping for... (i.e. using the DllImport attribute to directly load the OpenGL stuff from opengl32.dll)

    Edit: Just noticed too that the author of the project says he uses the CsGL library by Lloyd Dupont. That seems to be the standard way most people use OpenGL in C#.

    [This message has been edited by Deiussum (edited 05-06-2002).]
    Deiussum
    Software Engineer and OpenGL enthusiast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •