• Advertisement

2D Best API for 2D animations

Recommended Posts

Hi,

I'm making a program which displays simple 2D animations (think text and images scrolling over the screen) and I'm wondering what API would be best to use. Two important factors here are 1) being pixel perfect 2) never miss a frame, always 60 FPS.

My target is primarily Windows (7 and newer) but being cross-platform would be a plus.

I started with GDI (i e, the normal Windows thing) which is good from a pixel perfect perspective, but has a hard time reaching 60 FPS.

I have started to look into OpenGL but I'm not sure it's the right choice w r t being pixel perfect.

As for never missing a frame, would DirectX be better due to its swapchain feature? (Input lag is not an issue here so a few frames in-flight would not hurt.)

I guess Vulkan is a bit overkill and the amount of machines not supporting Vulcan is a big minus at this point.

What about web technologies such as WebGL (or 2D Canvas) + CEF (Chromium Embedded Framework)? If that is smooth enough, that would also be a very interesting option.

What do you think?

Share this post


Link to post
Share on other sites
Advertisement

Hi I think you could go for DirectX (11) or OpenGL, I will stick with the last as supports multiple platforms. You should be able to reach the 60FPS in both APIs, it will only depend on the amount of work you push to the GPU and how well is everything programmed :) . Same for pixel perfect, it should be doable in both.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Manuel Berger
      Hello fellow devs!
      Once again I started working on an 2D adventure game and right now I'm doing the character-movement/animation. I'm not a big math guy and I was happy about my solution, but soon I realized that it's flawed.
      My player has 5 walking-animations, mirrored for the left side: up, upright, right, downright, down. With the atan2 function I get the angle between player and destination. To get an index from 0 to 4, I divide PI by 5 and see how many times it goes into the player-destination angle.

      In Pseudo-Code:
      angle = atan2(destination.x - player.x, destination.y - player.y) //swapped y and x to get mirrored angle around the y axis
      index = (int) (angle / (PI / 5));
      PlayAnimation(index); //0 = up, 1 = up_right, 2 = right, 3 = down_right, 4 = down

      Besides the fact that when angle is equal to PI it produces an index of 5, this works like a charm. Or at least I thought so at first. When I tested it, I realized that the up and down animation is playing more often than the others, which is pretty logical, since they have double the angle.

      What I'm trying to achieve is something like this, but with equal angles, so that up and down has the same range as all other directions.

      I can't get my head around it. Any suggestions? Is the whole approach doomed?

      Thank you in advance for any input!
       
    • By Allagia X
      An original fantasy RP game needs dedicated, self-motivated, and chill individuals! We have a story and general plot already set up, ready to be expanded upon. 

      Miasma: Twilight Decree is a 2D roleplay adventure game. It’s set in a unique fantasy world with a vast map containing continents and oceans alike. Players are given one objective: to endure the troublous environments Allagia have to offer and successfully progress through time to reach the Age of Technology. The stakes are high, and every character’s actions can alter the world – or reset everything back to the beginning ages. MTD features a blend of survival aspects, dark themes, with the ability to make a mark in the history books.

      What we're currently looking for:
       
      • Writers - Super creative individuals who have experience in lore-making, world-building, and know their way around fantasy writing. All of the general elements are here [setting, plot, etc.] and need some "fluffing out"[quest lines, clans/ factions/ families, etc.]. Bonus points to those who can whip up spells and skills.
      • Artists - Mainly those who specialize in pixelated art, or people who can make concept art [since we lack pictures]. 
      • Project Manager - Someone who is organized and can keep this project on the rails. As thorough as I am, it's difficult to cover all the bases on my own. 
      • Other Positions - Anything else to fill in the gaps. We currently use Wikidot for our wiki; someone with CSS and syntax experience to polish it up would be awesome. A musician/ composer for all things musical. Way later down the road, we'll need community managers, DMs, and the such, though it isn't necessary at the moment. 

      Other information:

      I've been working on this project since the beginning of 2017 with a group of friends. Life basically prohibited a lot of us from continuing on with it, and it went on hiatus for a while. I'm making an attempt to bring this back from the dead since plenty of time and effort went into it beforehand. It goes without saying that I also have a passion for roleplaying. 

      I cannot stress enough that anyone interested should be into fantasy settings or D&D. Otherwise, you're probably not going to have fun with helping!

      We do have a Patreon with a few supporters, and Discord. Until things really start moving, we'll be using Discord to collaborate. 

      For any questions, comments, or concerns, feel free to comment below or add me on discord @ Allagia X#9174 [best method of contact] for more info about this project.
    • By Terry Jin
      Hi everyone! 

      I am from an indie studio that has received funding for our concept and is ready to create the next generation 2D Pokemon-inspired MMORPG called Phantasy World. This ad is for a volunteer position but hopefully will transition into something more. Our vision is to create a game that draws inspiration from the series but is dramatically different in both aesthetics and gameplay as the work would be our own.
       
      We are hoping that you can help us make this a reality and are looking for game developers familiar with the unreal engine and would be happy to work on a 2D top down game. Sprite artists are also welcome as we are in desperate need of talented artists! Join our discord and let's have a chat! https://discord.gg/hfDxwDX

      Here's some of our in game sprites for playable characters while moving around the game world! Hope to see you soon!
       


    • By Sean Meredith
      Hi all, I am starting to develop a tactics game and ran into a problem I had not thought of. I began by drawing a screen with a hex grid, and this is no big deal. I got that working fine. But, I realized it didn't look quite right. This is because in most strategy games, you're not looking straight down. There is a bit of a tilt. Attached is an example of what I mean. The hexagons on bottom are larger than the hexagons on top, and I'm unsure of how to go about adding this effect. Especially when you consider that some maps may be of different sizes. 
      I'm not sure if this is the right place to post something like this, but it seems as though some sort of linear transformation would be applied? No? I don't even know where to begin in a problem like this.
      Thanks.

    • By nick1
      Hello,

      I have limited programming experience in C++, but have always had a passion for games.  Where do I start?  I have a rough idea of the type of game I want to develop and am ready to commit the time necessary to learn new languages.  Are mobile games too difficult to begin with? Should I begin learning the basics of keyboard controls before attempting touch screens?  I would appreciate any input or advice!
      Thanks!
      Nick1
  • Advertisement