Hello,
line 22 of the file libg15render.h I see :
#define G15_BUFFER_LEN 1048
It is a big problem because my screen LEN is 6880.
When I try to fill the screen, only the first 1048 pixels are filled :
int draw(int g15_screen){ </p>
<p>g15canvas * my_g15canvas;<br />
my_g15canvas = malloc( sizeof(g15canvas) ); </p>
<p>/* Init the canvas */<br />
g15r_initCanvas(my_g15canvas); </p>
<p>/* Draw on the screen */<br />
g15r_clearScreen(my_g15canvas, G15_COLOR_BLACK); </p>
<p>/* Send the image to the daemon */<br />
if( g15_send(g15_screen, (char*)my_g15canvas->buffer, G15_BUFSIZE) == -1 ){<br />
fprintf(stderr, "draw: error 1 (g15_send).\n");<br />
return(-1);<br />
} </p>
<p>/* Stand during 1 second */<br />
sleep(5); </p>
<p>free(my_g15canvas); </p>
<p>return(0);<br />
}
Can you explain me why the G15_BUFFER_LEN is only 1048 pixels?
Thank you.
Re: G15_BUFFER_LEN 1048 ?!?
I see :)
So now I use G15_G15RBUF to initialize my screen :
<br /> /* Open a screen */<br /> if( (g15_screen = new_g15_screen(G15_G15RBUF)) == -1 ){<br /> fprintf(stderr, "main: error 2 (new_g15_screen).\n");<br /> return(-1);<br /> }<br />For send I use G15_BUFFER_LEN :
<br /> /* Send the image to the daemon */<br /> if( g15_send(g15_screen, (char*)my_g15canvas->buffer, G15_BUFFER_LEN) == -1 ){<br /> fprintf(stderr, "draw: error 1 (g15_send).\n");<br /> return(-1);<br /> }<br />And it works fine.
The proves, my new projects :
https://sourceforge.net/projects/draw-on-g15/
https://addons.mozilla.org/fr/firefox/addon/12070
Can you try my Firefox addon and give an evaluation (mark) on the web site?
Thank you.
Re: G15_BUFFER_LEN 1048 ?!?
The LCD is 6880 pixels (160x43), but the G15 buffer format is packed so it uses one bit per pixel as it is a monochrome display. Thus the buffer length of 1048 bytes can hold 8384 pixels, though the first 32 bytes are control data and the bytes after the LCD data are unused AFAIK. G15Daemon does have a buffer mode that is one byte per pixel with no padding and thus would expect a 6880 byte input, but that is not the buffer mode you should be using if you are using libg15render. G15Daemon will convert the 6880 byte format into the 1048 byte format before sending it to libg15 for display anyways, so it is more efficient to use the packed format from the beginning.