Skip to main content
GameDev.net gamedev.net
🔒 Locked

Creating a Graphics Engine (C#)

Started by Shaarigan Nov 25, 2011 at 10:30 AM 2 replies 1.9k views
Original Post
Shaarigan
Shaarigan
-closed-
Instigator
Instigator
I would start by going out and getting a book or looking around for e-books so you do not even have to leave your house.
M6dEEp
M6dEEp
Another good move is to look around at some pre existing solutions. I'm going to assume that you're using XNA since you've mentioned C# and one great graphics API freely available is Xen, http://xen.codeplex.com/.
Whenever I set out make something over using someone else's framework I usually look at those anyway to see what I would need and how to go about implementing it.
kunos
kunos

Moin,

is there or are there any rules on successfull creating a graphics engine in C# baesd on OpenGL to know
what it generaly could do and what it let the user do to create games with it?

What advices could you give to us to make a graphics engine?


if you need to ask this, the best advice is: dont do it.

Anyhow.. these are some advices you might want to consider:

- To write a C#/OpenGL engine, make sure you are both familiar with C# and OpenGL rolleyes.gif . OpenGL is a C library, 99% of the code and books you will find will assume a C/C++ environment. You will have to be experienced enough to "translate" this into C# world. It's very easy, but make sure you are confident in this area.

- Get confident with "unsafe" C# extensions as well the standard interop functionalities. Then benchmark and design your code according to needs/results.

- Use a pre-made OpenGL binding such as OpenTK. If you want a 1:1 mapping, it is unlikely you'll come up with a better solution.

- If you don't want a 1:1 mapping, write a C/C++ layer between your C# code and OpenGL. This will reduce the number of context switches and, it will be always be faster than calling OpenGL functions one by one. Of course the downside of this approach is that you will have a % of your code in C# and a % in C++.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.