• Advertisement
Sign in to follow this  

General questions about game engines and frameworks

This topic is 667 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to make a game engine (for learning purposes) just to make a character move around a screen. I started this in SFML, but I was curious about what DirectX and OpenGL are. Do you use DirectX/OpenGL in conjunction with SFML/SDL, or are DirectX/OpenGL a substitute for those.

I have a good bit of C++ knowledge so I was hoping to build a simple engine using that. Any recommendations on a framework that I could use?

 

Thank you!

Share this post


Link to post
Share on other sites
Advertisement

OpenGL and DirectX are low level APIs that give you indirect access to the GPU and allow you to draw things to the screen using hardware.

 

SFML has 5 modules: system, window, audio, networking, and graphics. The graphics module uses OpenGL to draw things, and the window module creates an OpenGL context. The other 3 modules, as far as I know, do not use OpenGL.

 

So to answer the second part of your question - SFML and SDL are not substitutes for OpenGL/DirectX - they do provide a set of functions/classes that wrap OpenGL to try to make it a bit easier to use. You can, with both SFML and SDL, use your own OpenGL code in conjunction with theirs and their documentation shows exactly how to do this.

 

You cannot use Direct3D with SFML/SDL - though you could probably use it with SFML if you only use the audio, networking, and system modules.

 

EDIT: Also - SFML is a good framework to use if your wanting to learn to build your own engine in my opinion. It will take care of a lot of details to get you up and running - and as you learn you can disable modules replacing them with your own code if you would like - or with other libraries specific for the task at hand. For example - you could start with having SFML load your images from file, then later change that out with stb_image or devIL if you like.

Edited by EarthBanana

Share this post


Link to post
Share on other sites

I use OpenGL ontop of SFML. SFML creates the window, OpenGL does the graphics. This is because I needed some features SFML doesn't supply, otherwise I would've just used SFML without the added complexity of OpenGL.

 

Here's my explanation of what engines arehow you learn to make them, and what you should focus on when making them. Essentially, I subscribe to the "make games, not engines" mindset.

 

Hopefully that gives you some food for thought; good luck on your project.  :)

Share this post


Link to post
Share on other sites

I agree with SotL in all above articles.

 

Making an "engine" is fun - but making a game will lead you to a finished project. And finished projects are good for the heart and soul.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement