Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - GoldenMaster

Pages: [1]
1
Window / Bad Access Exception
« on: December 22, 2013, 06:12:00 pm »
Hi there,

This is my first C++ Programm and my first Project with SFML and i want to build a 2D "Chessfield" like game, where each Fields in my GameArea has its own Sprite.

Later on the GameArea should know which Fields are visible to the player and therefore draw only these that should be drawn. Currently my GameArea consists of a 10 x 10 Field array (wich is stored one dimensional because i couldnt get a dynamic 2 dimensional array running in c++) each Field has a draw function requireing the RenderWindow object and a position Vector.

The GameArea has a Draw function on its own which should decide wich fields to call and wich position to give these Sprite.

Because its my first Project i worked with the XCode Template and use the same Ressources (the img) and only tried to apply my Strukture to is.

Now i get a EXC_BAD_ACCESS (code=EXC_I386_GPFLT) Message in my Fields draw function.

Im Working on my Mac Book Pro with Maverick and the CLANG package of SFML.

To give better understanding of my code i upload the whole Solution named GoS (Game of Stones)

i have no clue what I'm doing wrong and for these who aren't interested in downloading a XCode solution i will paste my 2 classes and their .h files in Code sections below.


my main.cpp
(click to show/hide)
[/font]

field.h
(click to show/hide)
[/font]

field.cpp
(click to show/hide)
[/font]

GameArea.h
(click to show/hide)
[/font]

GameArea.cpp
(click to show/hide)


p.s.: sry i dont know how to get spoiler tags to work so bear with the whole load of sourcecode

edit: i had to remove the img used as texture becouse of the size limitation

Pages: [1]
anything