febriano's picture

3d game project questions

Hello i am making a 3d game using opentk on c# visual studio 2010 , and i was wondering about the game window how do i use it . Is it better for the game ( faster allocating ? ) than a windows form with the drag and drop glcontrol in it ? thanks for your time much appreciated


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
CXO2's picture

You can browse the examples at \Binaries\OpenTK\Release\Example.exe
Look at OpenGL section

there are example source code for each example
Or check the QuickStart template:
https://github.com/opentk/opentk/blob/gl4/Source/QuickStart/Game.cs

the Fiddler's picture

The important difference is that GameWindow does not allocate memory or trigger garbage collections during normal operation. Windows.Forms allocate memory on almost every event (e.g. whenever you move the mouse.)

If you are making a GUI, then this doesn't matter. If you are making a real-time game, then you need to avoid garbage collections during gameplay.

febriano's picture

thanks for your reply and time . I will not be making any GUI would rather have it as a real time game .I couldn't go to the link you provided it doesn't exist , and i want to know when i am using game window should i make the project as console ? or in windows form and drag and drop the gl control ? sorry for the late reply . Thanks

the Fiddler's picture

Create a "Console" project and follow the tutorial here: http://www.opentk.com/doc/chapter/0

If you wish, you can then remove the console by going to Project Properties -> Application and changing "Output type" from Console Application to Windows Application.

febriano's picture

thanks for the super fast reply will do , and will keep you updated thanks again

febriano's picture

will it make any difference if i used the game window in a normal windows form application ? is it possible ? also how do i add a 3d model ?

the Fiddler's picture

Mixing different windowing toolkits in the same process, such as WinForms and GameWindow/Qt/whatever, is not a good idea. It may work but there are side-effects and there's nothing OpenTK can do to solve them.

If you need WinForms, use OpenTK.GLControl instead.

To load a model you'd need to use a model loading library for the model format you are using or implement one yourself. OpenTK merely gives you low-level access to OpenGL - it's not a game engine (but you can use it to create a game engine.)

febriano's picture

i think i'd rather stick to the winforms instead of coding in the console , but will i be able to do in it the same things as in the gamewindow ? as for the loader i am trying to find one now .Thanks man much much appreciated