My name is Paul (or Paweł in my language) and I thought I would write a blog about 3D graphics and a small project I'm developing. For a very long time now I was interested in 3D graphics. During my studies I learned OpenGL through nehe.gamedev.net and that's how one of my biggest "loves" started. I worked on different projects connected with 3D realtime graphics - both in my jobs and at home - and in the 2012 I thought I would create a library that would allow me to quickly create simple tech demos, interactive logos or other, small 3D applications. In the mid 2012 I started developing it. I didn't have any name for it so I called it just "Graphics Framework".
Now, after over a year of development, I thought I could share it with the rest of the world. I don't have many examples of how to use my library but that's why I wanted to start a blog. If there will be someone who would like to read and see more of it, maybe I will have motivation to create new apps and improve my library.
Something more about my creation - Graphics Framework is a C++ library designed to ease development of small, realtime 3D applications like interactive logos or tech demos. It wraps graphics api calls into set of simple to use classes (i.e. shader, render target, vertex attribute, texture) that are independent of the graphics api. Currently it only supports OpenGL 3.3 core profile (not whole of course). In the future it will support other versions of OpenGL (with some extensions) and, hopefully, different versions of Direct3D. Library also contains additional class, which allows to easily create and display application window, and a set of interfaces that help track size of a application window, begin and end of a frame rendering, mouse and keyboard input and passage of time.
So it's not only a 3D api wrapper but it also includes other classes that help create small 3D apps in a relatively short time. And that's why I didn't call it "Graphics Library" but "Graphics Framework". Besides, there are many different graphics libraries out there so I didn't want to create one more.
One more thing - right now library is developed for Windows only. But most of the classes are system independent so it should be possible to port it to some other OS.
Here is some example of a usage:
cWindow& window = cWindow::GetInstance(); if( !window.Create( "Shaiddir - Graphics Test", eGraphicsDeviceType::OPENGL_3, eWindowMode::WINDOWED, eAntialiasingMode::OFF, nullptr, nullptr ) ) { return 0; } cImage image( "image.jpg" ); cTextureImage texture_image( eTextureType::IMAGE_2D, { &image } ); cSampler sampler( eTextureWrapMode::MIRROR, eTextureFilteringMode::LINEAR ); cTexture texture( &texture_image, &sampler ); cShader vs( eShaderType::VERTEX_SHADER, "shader.vp" ); cShader fs( eShaderType::FRAGMENT_SHADER, "shader.fp" ); cEffect effect( &vs, &fs ); if( !effect.Init() ) { window.Destroy(); return 0; } effect.SetParameter( "uImage", texture ); cFullscreenQuad quad; quad.Init(); window.Run( Draw );And a drawing function could look like this:
void Draw( iGraphicsDevice* i_GraphicsDevice, iInputDevice* i_InputDevice, iTimer* i_Timer ) { i_GraphicsDevice->StartScene(); effect.Use(); quad.Draw(); i_GraphicsDevice->EndScene(); }And with this code image should be drawn covering whole application window (but I didn't test it ;-)). Of course You would need proper vertex and fragment shaders. But I hope this gives You an overview of an approach I have taken when I started creating this library.
That's all for now. I hope I'll have time to write something new soon.
Best regards.
No comments:
Post a Comment