First, if you are going to post to the forums, don't PM me the same question. Second, is that code the most up to date code? I tried to build in order to help and had to spend 2+ hours fixing errors in the code before giving up on it.
it is, i pm because i did post before and no one answered
Doing that is a quick way to be ignored.
I don't see how you are getting it to compile, let alone get it to the point of knowing that drawing font is an issue. When I first downloaded and compiled it I got errors in CAppStateGame.h and CAppStateGame.cpp:
Now the errors I got to have fun fixing while being distracted were:
CAppStateGame.cpp|58|error: no matching function for call to ‘CArea::OnLoad(const char [14])’|
CAppStateGame.cpp|62|error: no matching function for call to ‘CPlayer::OnLoad(const char [10], int, int, int)’|
CAppStateGame.cpp|66|error: no matching function for call to ‘CPlayer::OnLoad(const char [10], int, int, int)’|
CAppStateGame.cpp|122|error: no matching function for call to ‘CArea::OnRender(SDL_Surface*&, int, int)’|
CAppStateGame.cpp|127|error: no matching function for call to ‘CEntity::OnRender(SDL_Surface*&)’|
I'm going to take a wild guess that there are more after that one seeing as it says you are loading Yoshi.png and yet the assets have no yoshi.png in it.
I'm not going to worry about getting it to build. Since you said it was text, I started sifting through the code and the first thing that popped out was, where is TTF_Init();? I don't see it anywhere and from what I recall from SDL you have to call it first when dealing with TTF and SDL.
CApp_Oninit.cpp ln69
there is no error in the code, if you run the make, it will compile, the only is happening is, i can not draw text using this class or any other way on the Surf_Display.
i havent done sdl in forever so im not going to be much more help than this:
@bhx: sdl has many errr plugin type libraries for dealing with things, and one such is ttf. as a result, sdl's initialization functions dont do anything for it. thats why the library ttf has its own init function
@Little Bobby Tables
I know. I thought he had missed it because the IDE I was using couldn't find it, but I changed to Geany and it found it right before legendarysnake said where it was. I was getting errors from other parts of his code. I'm curious why make is compiling fine (though giving a lot of warning, which is still bad), but doing a project in all my IDEs return errors for so much of his code.
legendarysnake wrote:
there is no error in the code,
Then it would be printing ergo there is an error somewhere in the code. Could be something as simple as drawing in the wrong order or something more.
@legendarysnake
Trying to wrap my head around why you did the code the way you did. Honestly, I think you are doing a lot of things that may be considered bad habits. The way I was taught was to name the header file after the class that was in it and then in a C++ source file of the same name you define all of the methods. I was also taught to give int main() its own file (in my case I always do main.cpp).
In a hurry? The amount of time it took you to zip and upload that to that site you could have easily done a commit of the code to your github and linked to it.