Hello,
I just started trying to do some basic graphics programming with ggi. I
downloaded the latest snapshot, installed it and wrote a small program
based on the "dummies guide" available at www.ggi-project.org. It
compiles/links without any errors, but it refuses to work correctly. I am
under Linux 2.2.16, Slackware 7.1.
After I invoke the following program, the screen isn't cleared (i.e., the console
remains
visible) - it looks like this (if I run "clear" at the command line before
invoking the program):
manel@rolling:~/programas$ pixel
LibGG: unable to open lib: /usr/local/lib/ggi/default/fbdev/kgi/genkgi.so:
cannot open shared object file: No such file or directory
Then I press "Enter" and the prompt returns... When I ran some of the
available demo programs, I also got this error message, but the app worked
(I only saw the message *after* I quit the program and the console was
restored). I looked at the source for some demos and they seem to use pretty
much the same method... but I must be missing something. :)
Here is the source; I am compiling it with
$ gcc -o pixel pixel.c -lggi -lm
Thank you for any help,
Manuel
#include <ggi/ggi.h>
#include <stdio.h>
ggi_visual_t vis;
ggi_pixel white;
ggi_color map;
int main()
{
if (ggiInit())
{
printf("\nErro: ggiInit() falhou!\n");
return 1;
}
if ((vis=ggiOpen(NULL))==NULL)
{
ggiExit();
printf("\nErro: ggiOpen() falhou!\n");
return 2;
}
if (ggiSetSimpleMode(vis,GGI_AUTO,GGI_AUTO,GGI_AUTO,GT_AUTO)!=0)
{
ggiPanic("\nErro: imposs�vel definir modo a utilizar\n");
}
map.r=0xFFFF;
map.g=0xFFFF;
map.b=0xFFFF;
white=ggiMapColor(vis,&map);
ggiPutPixel(vis,0,0,white);
ggiClose(vis);
ggiExit();
getchar();
return 0;
}