-2

I am building a c++ maze project for school and want to create a 2d graphics window in c++ that will let me render something like this http://www.dreamincode.net/forums/uploads/monthly_07_2011/post-114496-13104660729008.png.

Can anyone suggest a 2d graphics library to use? I have looked into openGL but am worried that the geometry necessary is too complicated for what I need. Of course I may be overlooking some things.

I am working in Xcode on OS X and if the library is not multiplatform that is okay. Can anyone suggest me something?

genpfault
  • 51,148
  • 11
  • 85
  • 139
shane
  • 1,742
  • 2
  • 19
  • 36
  • 1
    Why are all these answers being down voted? The question is bad, because it asks for a tool, but these answers are answering just fine in my opinion. – 5Mixer Nov 11 '14 at 02:52
  • I know the question is bad, but in the sense that it is too nonspecific but tailored to one use case. I ask because there is nowhere else on the internet I can receive feedback like this. The answers are down voted because they support this kind of inquiry abuse. – shane Nov 11 '14 at 07:54
  • @user3667450 what is bad with OpenGL ? use GL_QUADS from GL 1.0 and you are fine ... (no need for perspective,textures,zbufer,...). btw I am windows programmer so I would go with GDI for this but on OS X have no clue if you have something similar. Also look here http://stackoverflow.com/a/23779490/2521214 it might be of help to your project – Spektre Nov 21 '14 at 11:53

2 Answers2

2

The Qt framework is a cross-platform solution for building applications.

There is a basic drawing example that shows how to use basic graphic primitives:

enter image description here

The core of the technique consists in reimplementing a widget's paintEvent() method to control how it is displayed (painted) on the screen. The QPainter class provides many drawing methods to suit your needs.

karlphillip
  • 92,053
  • 36
  • 243
  • 426
0

Since cross-platform is not a problem, just use Quartz or SpriteKit. Quartz is general 2D drawing, SpriteKit is specifically for games. All the docs you can access directly in Xcode through the documentation window, and Apple provides a bunch of sample code too.

pyj
  • 1,489
  • 11
  • 19