Jump to content

  • Log In with Google      Sign In   
  • Create Account

Want to move onto a graphics library


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
16 replies to this topic

#1 PvtFreddy   Members   -  Reputation: 97

Like
0Likes
Like

Posted 29 July 2014 - 04:14 AM

Hello all,

 

I've just joined the site so I hope that I am posting in the correct forum. If not, then I am terribly sorry for the trouble.

 

I have a question for those who are wise about programming libraries like DirectX, SDL and OpenGL. I have been programming in C++ for almost 4 years now and understand the basics, including the STL. I have picked up a book on DirectX and SDL and understand the code inside them. I think I am ready for moving onto a library to begin using graphics. I also know and understand how to build a Window using the Windows API.

 

My question is this: What library is the best (not so much easiest) to begin with? I have no hopes of designing a game. I just wish to mess around with the graphics, input, sound, etc. so I obtain a better understanding of how it works and how to write it.

 

Thank you,

 

Lewis



Sponsor:

#2 LennyLen   Crossbones+   -  Reputation: 4021

Like
0Likes
Like

Posted 29 July 2014 - 05:13 AM


My question is this: What library is the best (not so much easiest) to begin with? I have no hopes of designing a game. I just wish to mess around with the graphics, input, sound, etc. so I obtain a better understanding of how it works and how to write it.

 

Based on this, you want a multi-purpose library, and not just a graphics library.  OpenGL is purely a graphics library, so doesn't handle sound and input.

 

DirectX can handle all of these, but then you're limited to Windows only.

 

There are three widely used cross-platform libraries: SDL, Allegro, and SFML.  The first two are C libraries, and SFML is C++. They all have similar APIs and learning curves.

 

The best for you depends on what you want.  If you don't care about cross-platform and are using Windows, then DirectX is probably the best choice as there is a great deal of documentation for it, both online and in book form.  If you do want cross-platform support, then it depends on if you want a C++ library or a C library.



#3 PvtFreddy   Members   -  Reputation: 97

Like
0Likes
Like

Posted 29 July 2014 - 05:31 AM

I am a beginner in this field so I am just learning. In my C++ course I was always told that once you have one language down then others follow easier. Isn't this the same for libraries? If so, I am not that worried. I just want to get some knowledge to one day create a VERY basic game.

 

Thank you for your reply,

 

Lewis.



#4 LennyLen   Crossbones+   -  Reputation: 4021

Like
0Likes
Like

Posted 29 July 2014 - 06:01 AM

You can use the C libraries in C++. In fact I use Allegro myself with C++.  Some people just prefer a library that was built with C++ in mind from the ground up.



#5 Fiddler   Members   -  Reputation: 856

Like
0Likes
Like

Posted 29 July 2014 - 06:04 AM

I am a beginner in this field so I am just learning. In my C++ course I was always told that once you have one language down then others follow easier. Isn't this the same for libraries? If so, I am not that worried. I just want to get some knowledge to one day create a VERY basic game.

 

Thank you for your reply,

 

Lewis.

That's very true.

 

Allegro, SDL and GLFW cover what you need. Any of those would be suitable.

 

My 2cc: use SDL2.

 

Moving to any other library will be trivial once you get the hang of it.


[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]


#6 PvtFreddy   Members   -  Reputation: 97

Like
-1Likes
Like

Posted 29 July 2014 - 06:27 AM

Thank you very much for the information. May I ask one other question?

 

How do I include the .lib files to Visual Studio for SLD2?



#7 Fiddler   Members   -  Reputation: 856

Like
0Likes
Like

Posted 29 July 2014 - 07:55 AM

In your project properties (alt-enter), under Linker / Input / Additional Dependencies


[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]


#8 superman3275   Crossbones+   -  Reputation: 2061

Like
0Likes
Like

Posted 29 July 2014 - 07:58 AM

I recommend SFML.


Edited by superman3275, 29 July 2014 - 07:59 AM.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#9 SeanMiddleditch   Members   -  Reputation: 7152

Like
0Likes
Like

Posted 29 July 2014 - 10:03 AM

How do I include the .lib files to Visual Studio for SLD2?


http://www.libsdl.org/tmp/SDL/VisualC.html

#10 Fredericvo   Members   -  Reputation: 463

Like
-1Likes
Like

Posted 30 July 2014 - 07:08 PM

How do I include the .lib files to Visual Studio for SLD2?

#pragma comment(lib,'SDL2.lib')
#pragma comment(lib,'SDL2main.lib')

#11 Misantes   GDNet+   -  Reputation: 1198

Like
0Likes
Like

Posted 30 July 2014 - 11:59 PM


Based on this, you want a multi-purpose library, and not just a graphics library.  OpenGL is purely a graphics library, so doesn't handle sound and input.

 

I just wanted to note that OpenGL and SFML work nicely together however(or glfw, if you want another option), and the sound/input parts of SFML are rather easy to implement(same goes for glfw). So, I'd say to not let this deter you too much from OpenGL.  Between the three you really have most of the basics covered I think. If you are looking for a cross-platform and open source library, I still think OpenGL is a pretty viable option for you.


Beginner here <- please take any opinions with grain of salt :P


#12 PvtFreddy   Members   -  Reputation: 97

Like
-1Likes
Like

Posted 31 July 2014 - 06:05 AM

 

How do I include the .lib files to Visual Studio for SLD2?

#pragma comment(lib,'SDL2.lib')
#pragma comment(lib,'SDL2main.lib')

 

Pasted into my Evernote. Thank you.



#13 LennyLen   Crossbones+   -  Reputation: 4021

Like
1Likes
Like

Posted 31 July 2014 - 09:29 AM

 

 

How do I include the .lib files to Visual Studio for SLD2?

#pragma comment(lib,'SDL2.lib')
#pragma comment(lib,'SDL2main.lib')

 

Pasted into my Evernote. Thank you.

 

 

Don't use it in code you want anyone else to compile, as that will only work with MSVC.



#14 Fredericvo   Members   -  Reputation: 463

Like
0Likes
Like

Posted 31 July 2014 - 03:11 PM

How do I include the .lib files to Visual Studio for SLD2?

#pragma comment(lib,'SDL2.lib')
#pragma comment(lib,'SDL2main.lib')
Pasted into my Evernote. Thank you.
 
Don't use it in code you want anyone else to compile, as that will only work with MSVC.

True but he said visual studio explicitly. Ironically I edited my post removing "windows only" for this very reason. Lol

#15 PvtFreddy   Members   -  Reputation: 97

Like
0Likes
Like

Posted 01 August 2014 - 05:30 PM

Starting to learn DirectX and looking into SDL. I am taking in a step at a time, looking up 2D graphics creation at the moment. I have finally got a window with a picture on it. Now, I just need to know how to develop sprites then use them in the program. Doesn't sound difficult now, does it...?



#16 LennyLen   Crossbones+   -  Reputation: 4021

Like
0Likes
Like

Posted 02 August 2014 - 06:29 AM


True but he said visual studio explicitly.

 

I just wanted him to be aware that while it might work for him while using VS, if he gave the code to someone else to compile, it might not work for them.



#17 Fredericvo   Members   -  Reputation: 463

Like
0Likes
Like

Posted 02 August 2014 - 08:37 AM

 


True but he said visual studio explicitly.

 

I just wanted him to be aware that while it might work for him while using VS, if he gave the code to someone else to compile, it might not work for them.

 

True but I think the pragmas are ignored by other compilers but have the added benefit to sort of self-document all required libs whereas IDE configurations etc get lost in translation and he would have to reconfigure his different IDE with whatever that uses to find libraries anyway, whether the pragmas are present or not.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS