You are not logged in.

#1 2009-06-14 07:23:12

McDooosh
Member

[RESOLVED] Loading Graphics

I'm a very new programmer. I've converted a jpeg to C array with GIMP, but I'm having trouble compiling..

Code:

#include "../../../GRRLIB/GRRLIB/GRRLIB.h"   
#include <stdlib.h>                          
#include <math.h>                            
#include <wiiuse/wpad.h>                     
#include "gfx/StickFigga.h"

Mtx GXmodelView2D;  

int main() {

    u32 wpaddown;
    
    GRRLIB_texImg tex_StickFigga = GRRLIB_LoadTexture(StickFigga);

    GRRLIB_Init();                  
    WPAD_Init();                    
        
    while(1) {
        
        WPAD_ScanPads();
                
        wpaddown = WPAD_ButtonsDown(0);    
        
        GRRLIB_FillScreen(0xFFFFFFFF);
                
        GRRLIB_DrawImg(0, 0, tex_StickFigga, 0, 1, 1, 0xFFFFFFFF);
            
        GRRLIB_Render();
        
        if(wpaddown & WPAD_BUTTON_HOME) {
            exit(0);
        }    
    }    
    
    GRRLIB_Exit();
    
    free(tex_StickFigga.data);
    
    return 0;    
}

this is the error:

c:/devkitPro/grrlib/examples/template/source/main.c: In function 'main':
c:/devkitPro/grrlib/examples/template/source/main.c:17: error: 'StickFigga' undeclared (first use in this function)
c:/devkitPro/grrlib/examples/template/source/main.c:17: error: (Each undeclared identifier is reported only once
c:/devkitPro/grrlib/examples/template/source/main.c:17: error: for each function it appears in.)
c:/devkitPro/grrlib/examples/template/source/main.c:56:2: warning: no newline at end of file
make[1]: *** [main.o] Error 1
"make": *** [build] Error 2

Offline

 

#2 2009-06-14 15:27:07

NoNameNo
Administrator

Re: [RESOLVED] Loading Graphics

don't use gimp convertion, use you jpeg with the raw2c included in devkitpro.

Offline

 

#3 2009-06-14 15:43:43

Crayon
Bad Mother Fucker

Re: [RESOLVED] Loading Graphics

Or use WiiBuilder if you  are running Windows.

Offline

 

#4 2009-06-14 17:03:58

McDooosh
Member

Re: [RESOLVED] Loading Graphics

Wiibuilder works great!! Thanks a bunch...

Offline

 

#5 2009-06-14 18:20:51

NoNameNo
Administrator

Re: [RESOLVED] Loading Graphics

sorry Crayon, i'm so used to play with raw2c than i forgot sometime your marvellous tool !!! sorry wink

Offline

 

Board footer

Powered by FluxBB