zondag 10 maart 2013

Surprisingly Flawless

I think Pencil.Gaming deserves an update, because it's been going very well. The library works on Linux (both x86-64 and x84), Windows (x86-64 and x86) and Mac OS X, without any problems. The only thing I can do now really, is just adding some utilities (I've currently got utilities for audio loading, image loading and swapping the full-screen-y-ness of the window). I really want a model-loading utility (just .obj is fine), to make your life just that little bit less frustrating.

I've also added a post-build event which decompiles the project into CIL, replaces "callvirt (delegate function)" with "call (delegate function)" and compiles it again, resulting in a performance gain of up to 10%.

I think the project is already stable enough for a first beta version, if that was the way I wanted to go. I think I'll go for a rolling-release model, so I won't have to worry about versioning. And if that's the way I decide to go, then it's pretty much ready for use in pretty big projects! It's definitely stable enough to use in my next ludum dare project...

I will start working on a GLFW3 version as soon as I figure out how CMake works, since currently I've only managed to build a static library for it, which is quite obviously not what I want.

If do find any issues in the project, be it a mistake in the API, or an unstability on a particular platform, please tell me in the github repository (under the "Issues" section).

Stay tuned if you're interested!

15 opmerkingen:

  1. Here you have some tutorials following the first three from http://www.opengl-tutorial.org using Pencil.Gaming.

    Link: https://mega.co.nz/#!Il9E2SYC!c07gSx5ZJ02Xw4tJQjrT1xp2g49Lap4E59g-pn7hVjU

    Now its really easy to follow c++ tutorials and write your code in c#!!!

    I'll try to complete with all Basic tutorials during this week.

    Keep the good work!!!

    BeantwoordenVerwijderen
    Reacties
    1. Thanks for the tutorials! I might add them to the official repository (which has moved btw, it's now "https://github.com/antonijn/Pencil.Gaming"). If I do, I will change around your code a bit, to make it a bit more... erm... readable (no offense :) ).

      Also, *it's :P

      Verwijderen
    2. No problem, feel free to change them as you need. They are just a rough translation from the ones written in c++.

      Im almost done with number 8!

      Verwijderen
  2. Here is a benchmark just to make things interesting!
    http://constyspace.blogspot.gr/2013/03/simple-pencilgaming-benchmark.html

    BeantwoordenVerwijderen
  3. According to the latest release there are significant changes in the API, is there an example how to initialize a Window context?

    BeantwoordenVerwijderen
    Reacties
    1. There are no significant changes in the API, it's just not backwards compatible (the Gl class has been renamed GL and Al has been renamed AL).

      There is no change in creating windows (the Glfw class has been left intact).

      Verwijderen
  4. Hi Antonijn,

    How are things going with this project? I really want to start developing a large NET application with this wrapper, but not being able to working with GLFW3 and x64 on Windows makes me reconsider using this at all. The x32 wrapper works, but I will only use x64. Anyway I understand that you are probably very busy with school so I'll wait.

    BeantwoordenVerwijderen
    Reacties
    1. Hey Peter,

      Things are going fine. The GLFW2 version works great on all platforms afaik. As for the GLFW3 version, I've decided to postpone work on that until the first version of GLFW3 actually comes out. Since most development on GLFW3 is finished, I don't expect this to take long, but the current versions are a real pain to get working.

      Verwijderen
    2. I've tested your lib on 64bit windows 7. So far 64bit works. There is an error(delegate) when getting the video mode out of the monitor struct.

      monitor = Glfw.GetPrimaryMonitor();

      video = Glfw.GetVideoMode( monitor ); /// ERROR NULL

      win = Glfw.CreateWindow( 1024, 768, "Testing", GlfwMonitorPtr.Null, GlfwWindowPtr.Null );

      Good work btw

      Verwijderen
    3. I am still playing with the 64bitWindows version.

      I'm still get NULL error on Glfw.GetVideoMode( monitor ). Also, the Gl.SwapInterval(T/F) seems to not work either, it is rendering at full speed.

      I'm going to get the QuickFont texting rendering extension from OpenTK to work with Pencil.Gaming(Compatibility Mode).

      Verwijderen
    4. If you'd be so kind to provide a pastebin or something to your code then that would be nice. You need to understand that I simply can't work out whether it's my fault or your fault from these claims alone.

      Verwijderen
    5. Well, I downloaded the latest code and I no longer get the null error when calling the function:

      video = Glfw.GetVideoMode( monitor );

      Anyhow, I've added QuickFont to the project and everything seems to work.
      --> Download your GitHub-Pencil.Gaming-master solution.
      --> Download my mods @ http://www.perfectionstudio.com (antonj)
      --> Extract and overwrite your master solution...everything should work.

      What I did was:
      1. Changed the solution from class library to Application (for testing)
      2. Added two files to the BIN folder (times.ttf and dahlia.png)
      3. Added an Application folder with program.cs (test-code)
      4. Added a QuickFont folder with all its code (modified a little bit)
      5. Change the build settings to include FULL Debug data (optional)

      Question: How can I make use of the monitor/video/window structure as it doesn't have access to the native structure?

      When I tried to render to a second window/context, opengl doesn't seem to share the texture/resources to the second window...it that correct?

      Verwijderen
    6. Answer: You wouldn't have access in native GLFW either, that would cripple the cross-platformness.

      And yes, it is correct that opengl resources are per-context.

      Verwijderen
    7. After some testing, I find that the GlfwSwapInterval function is not working properly. Regardless of (true/false) setting, it does not synchronize to monitor refresh rate on some computer and completely opposite on other computer. Because of this, I could not get smooth animation without hammering the CPU or GPU or both, or choppy timing code.

      Verwijderen
  5. Hi is there any way to get pencil gaming window to run in a embeded in a winform similar to the opentk control

    BeantwoordenVerwijderen