[ HPGCC ] GGL Library question - Hewlett Packard

This is a discussion on [ HPGCC ] GGL Library question - Hewlett Packard ; Thx Claudio Lapilli, for the little program to convert bmp2c file. I think its correct i don't test it on my calc (if the color are ok) I don't understand how i can use GGL library (what i must put.. ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: [ HPGCC ] GGL Library question

  1. [ HPGCC ] GGL Library question

    Thx Claudio Lapilli, for the little program to convert bmp2c file.

    I think its correct i don't test it on my calc (if the color are ok)

    I don't understand how i can use GGL library (what i must put.. )

    Its look like a bit complicated if i compare with hpg.

    i have a image called newimg.c named newimg (in the code ) is 30x30 i
    want to clear the screen and put it on screen.

    this is possible to give me the minimum i want to show it on screen
    lol.

    Another question i make a entire interface sceeen with hpg i see
    ggl_gethpgscreen. This is what i need to put image from ggl to hpg ?


  2. Re: GGL Library question

    On Apr 2, 10:48 am, WildcatQue...@gmail.com wrote:
    > Thx Claudio Lapilli, for the little program to convert bmp2c file.
    >
    > I think its correct i don't test it on my calc (if the color are ok)
    >
    > I don't understand how i can use GGL library (what i must put.. )
    >
    > Its look like a bit complicated if i compare with hpg.


    Not really, it has lots of advanced stuff but if all you want to do is
    display an image, it's very simple.

    >
    > i have a image called newimg.c named newimg (in the code ) is 30x30 i
    > want to clear the screen and put it on screen.
    >
    > this is possible to give me the minimum i want to show it on screen
    > lol.
    >
    > Another question i make a entire interface sceeen with hpg i see
    > ggl_gethpgscreen. This is what i need to put image from ggl to hpg ?


    I assume you have already initialized hpg, set the mode to 16 grays
    and cleared the screen.

    All you need to do is:

    1) Initialize ggl, you should do it right after you initialize hpg and
    change the mode.

    gglsurface gglscreen;
    ggl_gethpgscreen(&gglscreen);

    2) Prepare your image:

    gglsurface myimage;

    myimage.addr=&newimage; // I ASSUME newimage IS THE ARRAY FROM THE
    CONVERTED FILE
    myimage.width=30;
    myimage.x=myimage.y=0;

    3) Set the coordinates on the screen where you want to show your image

    gglscreen.x=0;
    gglscreen.y=0; // 0,0 = upper-left corner of the screen, y is
    positive going down

    4) Show the image:

    ggl_bitblt(&gglscreen,&myimage,30,30); // COPY 30x30 PIXELS FROM
    myimage(0,0) to gglscreen(0,0)

    Please read the documentation of GGL, it's fairly complete and also
    look at the examples.

    http://hpgcc.org/hpgcc/doc_html/ggl/

    Regards,
    Claudio


  3. Re: GGL Library question

    On 2 avr, 18:26, "Claudio Lapilli" wrote:
    > On Apr 2, 10:48 am, WildcatQue...@gmail.com wrote:
    >
    > > Thx Claudio Lapilli, for the little program to convert bmp2c file.

    >
    > > I think its correct i don't test it on my calc (if the color are ok)

    >
    > > I don't understand how i can use GGL library (what i must put.. )

    >
    > > Its look like a bit complicated if i compare with hpg.

    >
    > Not really, it has lots of advanced stuff but if all you want to do is
    > display an image, it's very simple.
    >
    >
    >
    > > i have a image called newimg.c named newimg (in the code ) is 30x30 i
    > > want to clear the screen and put it on screen.

    >
    > > this is possible to give me the minimum i want to show it on screen
    > > lol.

    >
    > > Another question i make a entire interface sceeen with hpg i see
    > > ggl_gethpgscreen. This is what i need to put image from ggl to hpg ?

    >
    > I assume you have already initialized hpg, set the mode to 16 grays
    > and cleared the screen.
    >
    > All you need to do is:
    >
    > 1) Initialize ggl, you should do it right after you initialize hpg and
    > change the mode.
    >
    > gglsurface gglscreen;
    > ggl_gethpgscreen(&gglscreen);
    >
    > 2) Prepare your image:
    >
    > gglsurface myimage;
    >
    > myimage.addr=&newimage; // I ASSUME newimage IS THE ARRAY FROM THE
    > CONVERTED FILE
    > myimage.width=30;
    > myimage.x=myimage.y=0;
    >
    > 3) Set the coordinates on the screen where you want to show your image
    >
    > gglscreen.x=0;
    > gglscreen.y=0; // 0,0 = upper-left corner of the screen, y is
    > positive going down
    >
    > 4) Show the image:
    >
    > ggl_bitblt(&gglscreen,&myimage,30,30); // COPY 30x30 PIXELS FROM
    > myimage(0,0) to gglscreen(0,0)
    >
    > Please read the documentation of GGL, it's fairly complete and also
    > look at the examples.
    >
    > http://hpgcc.org/hpgcc/doc_html/ggl/
    >
    > Regards,
    > Claudio



    Ok first of all i see a little difference from my image and yours (at
    the end of mine i have 0x ) its give me a error and i remove it.
    I try your code but i don't know where im wrong. i have this error :

    test.c:31: warning: assignment from incompatible pointer type
    test.c:43:2: warning: no newline at end of file
    test.c:42: warning: control reaches end of non-void function
    test.c.text+0x10): undefined reference to `ggl_gethpgscreen'
    test.c.text+0x2e): undefined reference to `ggl_bitblt'
    make: *** [test.exe] Error 1

    There is my source i put the newimage on it for the example but i have
    the same error when i have it on other file.
    #include
    #include
    #include
    // #include "images/newimage.c"

    unsigned int newimage[]= {
    // WIDTH 30
    // HEIGHT 30
    0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFF00,0xFFFF FFFF,0xFFFFFFFF,
    0xFF00FFFF,0xFFFFFFFF,
    0xFFFFFFFF,0xFFFFFFFF,0xFFFFFF00,0xFFFFFFFF,0xFFFF FFFF,0xFF00FFFF,
    0xFFFFFFFF,0xFFFFFFFF,
    0xFFFFFFFF,0xFFFFFF00,0xFFFFFFFF,0xFFFFFFFF,0xFF00 FFFF,0xFFFFFFFF,
    0xFF00FFFF,0xFFFFFFFF,
    0xFFFFFF00,0xFFFFFFFF,0xFFFF00FF,0xFF00FFFF,0xFFFF FFFF,0xFFFFFFFF,
    0xFFFFFFF0,0xFFFFFF00,
    0xFFFFFFFF,0xFF0FFFFF,0xFF00FFFF,0xFFFFFFFF,0xFFFF FFFF,0xFFFF00FF,
    0xFFFFFF00,0xFFFFFFFF,
    0x00FFFFFF,0xFF00FFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFF FFFF,
    0xFFFFFF00,0xFFFFFFFF,0xFFFFFFFF,
    0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFF00FFF,0xFFFF FFFF,0xFFFFF00F,
    0x0FFFFFFF,0xFFFFFFFF,
    0x000FFF00,0xFFFFFFF0,0xFFFFFFFF,0xFF00FFFF,0xFFF0 0FFF,0xFFFFFFFF,
    0xFFFFFFFF,0xFFFFFF00,
    0xFFFFFFFF,0xFFF000FF,0xFF00FFFF,0xFFFFFFFF,0x000F FFFF,0xFFFFFFFF,
    0xFFFFFF00,0xFFFFFFFF,
    0xFF0FFF0F,0xFF00FFFF,0x000FFFFF,0xFFFF0FFF,0xFFFF FF0F,
    0xFFFFFF00,0xFFF0000F,0x00000FFF,
    0xFF00FFFF,0x0FFFFFFF,0xFFFFFFF0,0xFFFFFF0F,0xFFFF FF00,0xF00FFFFF,
    0xFF0FFF00,0xFF00FFFF,
    0xFFFFFFFF,0xFFFF0FFF,0xFFFFFFFF,0xFFFFFF00,0xFFFF FFFF,0xFFFFFFFF,
    0xFF00FFFF,0xFFFFFFFF,
    0xFFFFFFFF,0xFFFFFFFF,0xFFFFFF00,0xFFFFFFFF,0xFFFF FFFF,0xFF00FFFF,
    0xFFFFFFFF,0xFFFFFFFF,
    0xFFFFFFFF,0xFFFFFF00,0xFFFFFFFF,0xFFFFFFFF,0xFFFF FFFF,0xFFFFFFFF,
    0xFFFFFFFF,0xFFFFFFFF,
    }; // END OF BITMAP

    int main(void){
    hpg_set_mode_gray16 (0); //Enter 16 Gray mode, No Buffer.
    hpg_clear(); //Clear the screen .
    gglsurface gglscreen; //Init the surface .
    ggl_gethpgscreen(&gglscreen); //Prepares to draw on
    the LCD screen with GGL and HPG .
    gglsurface myimage; //Init the image myimage .
    myimage.addr = &newimage; //Setup for image myimage word aligned
    address .
    myimage.width = 30; //Setup for image myimage width.
    myimage.x = 0; //Setup for image myimage x .
    myimage.y = 0; //Setup for image myimage y .
    //Set the coordinates on the screen
    gglscreen.x=0;
    gglscreen.y=0;
    //Show the image -> COPY 30x30 PIXELS FROM myimage(0,0) to
    gglscreen(0,0)
    ggl_bitblt(&gglscreen,&myimage,30,30);

    while(!keyb_isON()); // Wait for On button .
    }

    Thx alot for your help, i check the ggl reference file and im confused
    but now this is really more clearly





  4. Re: GGL Library question


    > Please read the documentation of GGL, it's fairly complete and also
    > look at the examples.


    Im looking on the GGL Doc and i don't find a example
    this is possible ?
    i found the HPG example but not the GGL
    /doc_html/ggl/index.hml


  5. Re: GGL Library question

    On Apr 2, 8:31 pm, WildcatQue...@gmail.com wrote:

    > Ok first of all i see a little difference from my image and yours (at
    > the end of mine i have 0x ) its give me a error and i remove it.
    > I try your code but i don't know where im wrong. i have this error :
    >
    > test.c:31: warning: assignment from incompatible pointer type
    > test.c:43:2: warning: no newline at end of file
    > test.c:42: warning: control reaches end of non-void function
    > test.c.text+0x10): undefined reference to `ggl_gethpgscreen'
    > test.c.text+0x2e): undefined reference to `ggl_bitblt'
    > make: *** [test.exe] Error 1



    Your Makefile is not linking with the ggl library correctly. Check
    your makefile or use dmake.


    Claudio


  6. Re: GGL Library question

    On Apr 2, 8:34 pm, WildcatQue...@gmail.com wrote:
    > > Please read the documentation of GGL, it's fairly complete and also
    > > look at the examples.

    >
    > Im looking on the GGL Doc and i don't find a example
    > this is possible ?
    > i found the HPG example but not the GGL
    > /doc_html/ggl/index.hml


    The examples are not in the documentation. They are in the examples
    folder (hump game and maybe some others, I don't remember).

    Claudio


  7. Re: GGL Library question

    On 2 avr, 22:09, "Claudio Lapilli" wrote:
    > On Apr 2, 8:34 pm, WildcatQue...@gmail.com wrote:
    >
    > > > Please read the documentation of GGL, it's fairly complete and also
    > > > look at the examples.

    >
    > > Im looking on the GGL Doc and i don't find a example
    > > this is possible ?
    > > i found the HPG example but not the GGL
    > > /doc_html/ggl/index.hml

    >
    > The examples are not in the documentation. They are in the examples
    > folder (hump game and maybe some others, I don't remember).
    >
    > Claudio


    Nice now i can complile but i don't see the image correctly


  8. Re: GGL Library question

    On 2 avr, 22:18, WildcatQue...@gmail.com wrote:
    > On 2 avr, 22:09, "Claudio Lapilli" wrote:
    >
    > > On Apr 2, 8:34 pm, WildcatQue...@gmail.com wrote:

    >
    > > > > Please read the documentation of GGL, it's fairly complete and also
    > > > > look at the examples.

    >
    > > > Im looking on the GGL Doc and i don't find a example
    > > > this is possible ?
    > > > i found the HPG example but not the GGL
    > > > /doc_html/ggl/index.hml

    >
    > > The examples are not in the documentation. They are in the examples
    > > folder (hump game and maybe some others, I don't remember).

    >
    > > Claudio

    >
    > Nice now i can complile but i don't see the image correctly


    Ok i found the problem the c image i make are bad i test it with the
    background texture in hump and its work perfectly. I will test with
    the others image i make.
    Thx alot for all the help you provide to me.
    I will check myself tomorow on the web to make a other .c file , i see
    in some Gameboy Advance forum some utilities to make this. if i don't
    found a good way to make it i will reply but i will don't boring you
    for this now

    Thx again

    Sylvain


  9. Re: GGL Library question

    On 3 avr, 00:26, WildcatQue...@gmail.com wrote:
    > On 2 avr, 22:18, WildcatQue...@gmail.com wrote:
    >
    >
    >
    >
    >
    > > On 2 avr, 22:09, "Claudio Lapilli" wrote:

    >
    > > > On Apr 2, 8:34 pm, WildcatQue...@gmail.com wrote:

    >
    > > > > > Please read the documentation of GGL, it's fairly complete and also
    > > > > > look at the examples.

    >
    > > > > Im looking on the GGL Doc and i don't find a example
    > > > > this is possible ?
    > > > > i found the HPG example but not the GGL
    > > > > /doc_html/ggl/index.hml

    >
    > > > The examples are not in the documentation. They are in the examples
    > > > folder (hump game and maybe some others, I don't remember).

    >
    > > > Claudio

    >
    > > Nice now i can complile but i don't see the image correctly

    >
    > Ok i found the problem the c image i make are bad i test it with the
    > background texture in hump and its work perfectly. I will test with
    > the others image i make.
    > Thx alot for all the help you provide to me.
    > I will check myself tomorow on the web to make a other .c file , i see
    > in some Gameboy Advance forum some utilities to make this. if i don't
    > found a good way to make it i will reply but i will don't boring you
    > for this now
    >
    > Thx again
    >
    > Sylvain- Masquer le texte des messages prÚcÚdents -
    >
    > - Afficher le texte des messages prÚcÚdents -


    News Update
    Ok i think i must use a standard (ex: 8x8 , 16x16 , 24x24 32x32 ..) im
    not sure but the image look better and aligned when is a multiple of
    8.
    im not sure for this but is better.

    unfortunatly the image are not really good mayble some pixel are too
    black 70% of the image are good but some few of pixel are just wrong
    for the eye..
    i search a .c file editor but i don't find this application


+ Reply to Thread