the mystery of 2D vector graphics

Published April 12, 2017
Advertisement

2D graphics programming is important for a variety of reasons if you want to be a serious developer. Vector graphics are a math based computer graphics technologies that have become popular with artists, designers, and since the recent development of more advanced video graphics technology, are becoming popular in games.

I have been studying them mostly in the context of for use with menu's and overlays for games, and in my case, role playing games, because that's the kind of game company I have.

In the graphics programming world, we have:


Did you know, there are OpenVG implementations available from ImaginationTechnologies for Windows? For linux, there are a few API's available, but if you want full control over your game engine, you would have to implement the library yourself. This is one of the reasons why we don't see lots of linux games, and also another reason why web based games have gained in tremendous amounts of popularity. This is also why Android and iOS became such a popular platform to make games on. It is tough to make a cross platform game engine, though it is possible.

Here are some tips if you are thinking about writing your own game engine for a platform, and are serious about competing in the game industry:

For Directx programming: You have to use shared surfaces and know how to use them really great, and practice a lot with them. This coupled with multithreaded game loops, allows for writing to the back buffer of your game scene, from both Direct3D and Direct2D contexts. If you want to be able to do this, you should set goals to meet the following requirements.


  • Parsing your system for available graphics cards, and creating interfaces to them dynamically
  • Create Direct2D contexts
  • Create Direct3D contexts
  • Create memory safe multithreaded loops
    aEUR'
    aEUR'Once you can confidently do this, then you should look up shared surfaces in directx on msdn. This will allow you to create a great overlay menu for your 3D game. If you have a 2D game, learning some of the techniques will allow you to gain performance speedups in creating your game.


If you want to write a unix,linux game engine that is easy to transport games to linux, mac, then you have to implement your own openVG library with the headers from Khronos group. Obviously this is for OpenGL games. OpenVG provides a framework that would allow the development of a game engine or library that is easily usable by anyone using the openvg header, in case you make your project opensource. If you are just using it in house, then you get ideas from it, or partially implement it.


  • In OpenVG, you can write your own rasterizer, or you use OpenGL to render 2D graphics to the screen z-depth plane.


There are a variety of techniques for 2D programming speed ups I will talk about in upcoming blogs. I will also update these blogs with pictures, videos, and animations when I get the chance.

1 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement