Advertisement

Starting Graphics in coding

Started by August 26, 2016 03:15 AM
2 comments, last by Absurdon 8 years, 4 months ago

I'm really at loss. I'm a total beginner in this but i'm quite interested in gamedeveloping. What i want to know is the totpic on outputing graphic in codes. What i know as of now is that there are libary out there to use API and such. However I'm not quite confident in knowing all this terms for graphic and such...

What I'm using for programming is codeblock and I have tried SFML for outputing graphics. I'm still learning in this area but I'm currently still confuse.

If possible can anyone explain to me any of the question i provide...

What is an API?

What are GLUT, freeGlut, SDL and SFML used for and how do they relate to OpenGL?

Does CodeBlock already have all this above tools or do we have to download them and implement it?

I'm also confuse on what OpenGL does and do we need to download it or has our laptop already have them?

For creating a simple game what kind of tools would you need and graphical libary would you use? Lets say the game is pong how would you guys prepare to make such a game?

I'm sorry if some of the question is stupid but i'm really ignorant in any of this terms... I have tried reading many things at the web and this website but the more I read the more confused I am...

First of all, what kind of graphics programming are you targetting ? I mean there's a huge difference in doing 2D and 3D. There's also a lot difference in doing 'simple naive' 3D and reality-like 3D. There's also a lot of difference in doing real-time 3D graphics and non-real-time 3D graphics.

But maybe this is not that easy for you to answer to this for now. Anyway...

API means Application Programming Interface. Glut, SDL and SFML are APIs. This is a program, which is called a library, that provides an interface to the user (here functions, classes and other means) to be used in order to create an application. Internal code will generally be hidden so that all the complexity remains internal.

Glut, SDL and SFML are libraries that, among other things for the 2 latters, allow to create a window that is capable to render with OpenGL.

Most IDEs (like CodeBlock) are not providen with APIs. You will generally have to install (or sometimes even have to build them) and use them within your IDE.

OpenGL is not a library. It is a standard that defines interfaces for the programmer to be able to do graphical applications that will generally take profit of the hardware (and thus run fast). But libraries allowing to do OpenGL exist. Beginners will generally download header files in order to develop with the OpenGL (see this or this for example. These are headers and libraries that give the usable interface to develop with OpenGL). OpenGL capable drivers are also generally needed in order to be able to use the graphic hardware efficiently. With your IDE you'll have to point to these headers and link with your hardware drivers so that you'll 'do' OpenGL.

For doing simple games, almost if it's not 3D, OpenGL is not required (neither directx or vulkan...). You might just do it with your OS framebuffer. OpenGL is however, of course, able to do that. I would suggest you to start with SDL (or SFML) since you'll also be able to add audio, networking and so on with them.

Advertisement

Thank you so much @_Silence_ for your informative answer, you have pretty much explained to me most of the things that I did not fully understand. Right now I'll start of simple so I'll try to dwell into SFML more. I'll also check up on the on the header file you linked me to.

afaik with sfml you will not need these headers as sfml provides you with an opengl header file. check out sfmls documentation as it provides loads of resources on how to do certain things with sfml. You can find them here: http://www.sfml-dev.org/tutorials/2.4/

The sfml download also comes with quite alot of examples so you might want to open them and look at the code to see how things are done in there.

This topic is closed to new replies.

Advertisement