RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
Gardon
Scholar


Joined: 05 Feb 2006
Posts: 157

PostPosted: Sat Mar 04, 2006 10:28 pm    Post subject: I'm going crazy [quote]

Could someone please tell me why I have the same code in two different functions but it only works for one? If I try to load the bitmap in the Menu class it won't run, but it will in the Engine class.

IT will compile no matter what, it just depends if it runs or not.

take a look here if you can.

Also, I'm trying to make it so that it will revert back to the menu screen if the escape key is pressed. Why the fuck won't it work?


Sorry, normally I don't ask questions like these, but after 2+ hours of frustration and wasted time, I have no other choice.

Thanks again,

Jason
Back to top  
Ninkazu
Demon Hunter


Joined: 08 Aug 2002
Posts: 945
Location: Location:

PostPosted: Sat Mar 04, 2006 11:18 pm    Post subject: [quote]

Code:
  m_graphics = new Graphics(windowWidth, windowHeight, windowTitle, transRed, transGreen, transBlue,
                        backgroundRed, backgroundGreen, backgroundBlue, backgroundAlpha);

  m_mainMenuBitmap = m_graphics->LoadBitmap("Images/m.bmp");


Code:
  //m_mainMenuBitmap = m_graphics->LoadBitmap("Images/m.bmp");

  m_graphics = new Graphics(windowWidth, windowHeight, windowTitle, transRed, transGreen, transBlue, 255, 0, 0, backgroundAlpha);

Notice anything in particular? Order maybe? Also, you're not going to want to initialize SDL again and again every time you want a menu. Graphics should have one instance and should be allowed access by anything.
Back to top  
Gardon
Scholar


Joined: 05 Feb 2006
Posts: 157

PostPosted: Sun Mar 05, 2006 6:49 am    Post subject: [quote]

Yes, but it shouldn't matter. They are both independent of each other.

I wanted two graphic instances to make it easier for the time being, with clearing to background set to the default colors set upon initialization.

I don't believe it should matter, as long as they're only drawing themselves within their classes

Cya

jason
Back to top  
Gardon
Scholar


Joined: 05 Feb 2006
Posts: 157

PostPosted: Sun Mar 05, 2006 6:51 am    Post subject: [quote]

:( ok nevermind. i didnt' realize i initialized SDL in my graphics class... god it's been a long time since I've worked with that.

Ok. I'll jump on the problem tomorrow Cya later

Jason
Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum