Results 1 to 3 of 3

Thread: Where is my Image?

  1. #1
    Serf
    Join Date
    Mar 2008
    Posts
    2

    Post Where is my Image?

    Hi,

    I'm a newbie and I have a newbie question about CL_Image.

    My Hauptmenue class:

    Code:
    class Hauptmenue : public CL_Frame
    {
    	private:
    
    		CL_Surface	*Hintergrundgrafik;
    		CL_Image	*Hintergrund;
    		CL_Button	*Spielen,
    				*Einstellungen,
    				*Editor,
    				*Beenden;		
    
    	public:
    
    		Hauptmenue(CL_GUIManager *gui) : CL_Frame(CL_Rect(0,0,640,480), gui)
    		{
    			Hintergrundgrafik = new CL_Surface("Titel.tga");
    			Hintergrund = new CL_Image(CL_Rect(0, 0, 640, 480), Hintergrundgrafik, this);
    			Spielen = new CL_Button(CL_Rect(280, 290, 360, 320), "Spielen", this);
    			Einstellungen = new CL_Button(CL_Rect(280, 330, 360, 360), "Einstellungen", this);			
    			Editor = new CL_Button(CL_Rect(280, 370, 360, 400), "Editor", this);			
    			Beenden = new CL_Button(CL_Rect(280, 410, 360, 440), "Beenden", this);					
    		}
    };
    My Spiel class:

    Code:
    class Spiel : public CL_ClanApplication
    {
    	public:
    
    		CL_GUIManager *gui;
    		CL_StyleManager *style;
    		CL_Frame *hauptmenue;
    		 
    		virtual char *get_title()
      		{  
    			return "Mein erstes Clanlib Programm";  
    		}
    
    		void init_modules()
     		{  
    			CL_SetupCore::init();
    			CL_SetupDisplay::init();
    			CL_SetupGUI::init();
    			CL_SetupPNG::init();
    		}
    
     		void deinit_modules()
      		{  
    			CL_SetupCore::deinit();
    			CL_SetupDisplay::deinit();
    			CL_SetupGUI::deinit();
    			CL_SetupPNG::deinit();
    		}
    		
    		void render()
    		{
    
    			while (!CL_Keyboard::get_keycode(CL_KEY_ESCAPE))
    			{
    			
    				gui->show();
    
    				//CL_Display::clear_display(0, 0, 0, 1.0f);
    				//CL_Display::draw_line(0,0,639,479,1.0f,0.0f,0.0f);
    				CL_Display::flip_display();
    				CL_System::keep_alive(20);
    			}
    		
    		}
    
     		virtual int main(int, char **)
    		{  
    
    			init_modules();
    			CL_Display::set_videomode(640,480,32,false);
    			
    			CL_ResourceManager gui_resources("./GUIThemeDefault/gui.scr", false);			
    			style = new CL_StyleManager_Default(&gui_resources);			
    			gui = new CL_GUIManager(style);
    			Hauptmenue hauptmenue(gui);
    		 	Spielbrettauswahl spielbrettauswahl(gui);
    
    			render();			
    
    			deinit_modules();
    
    			return 0;
    		}
    };
    The Buttons are visible, but the image is not.
    What I'm doing wrong?
    Last edited by Martin; 03-16-2008 at 12:03 PM. Reason: Weitere Informationen

  2. #2
    Serf
    Join Date
    Mar 2008
    Posts
    2

    Unhappy Why i don't get any answers? Is my question too stupid?

    Hi guys,

    Nobody give me an answer. Why?
    Is my Question stupid?
    Do you need more Information?
    Or is there nobody who can give me an answer?

    This is my first post, here. It's a bit frustrating not to get any reaction.
    It would be cool, to know that I'm not alone with this nice but little documented
    lib.

    Martin

  3. #3
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,376

    Default

    This is 0.8 from SVN?

    I'd help if I could but I've never actually used CL_Frame like that before.

    All I can suggest is get in there with the debugger or possibly attach the whole project with the resources (Titel.tga/etc) as a zip, maybe someone can take a closer look at it.
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. Image Manipulation
    By joeymitchell in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 12-04-2007, 04:50 PM
  2. Rendering into my custom image and then drawing this image to the display
    By ValkaVALES in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 07-03-2007, 09:53 AM
  3. Image Drag&drop
    By jimbo in forum Novashell Game Creation System
    Replies: 0
    Last Post: 12-08-2006, 11:48 PM
  4. Image help
    By in forum Dink Smallwood HD
    Replies: 2
    Last Post: 02-04-2004, 08:42 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •