My name is Randall Barber,
[EMAIL PROTECTED]
I have two open visuals on Linux 6.2 X-Windows. I use one for drawing
primitives too and the other I use as an interactive color chooser (or I
will). They are named respectively, "screenBuf" and "colorBuf". The
code follows that I use to open them:
ggi_visual_t *screenBuf;
ggi_visual_t *colorBuf;
void main(void)
{
screenBuf = new ggi_visual_t;
colorBuf = new ggi_visual_t;
ggiInit();
*(screenBuf) = ggiOpen(NULL);
ggiCheckGraphMode(*(screenBuf), 800, 600, 800, 600, GT_32BIT,
&sug_mode);
ggiSetMode(*(screenBuf), &sug_mode);
*(colorBuf) = ggiOpen(NULL);
ggiCheckGraphMode(*(colorBuf), 448, 256, 448, 256, GT_32BIT,
&sug_mode);
ggiSetMode(*(colorBuf), &sug_mode);
.
.
.
}
As I understsand GGI, all I have to do now is call one of the API
functions and supply the appropriate visual and it will draw to that
visual. For instance,
map.r = 0x00; map.b = map.g = 0;
color = ggiMapColor(*(sceenBuf), &map);
ggiPutPixel(*(screenBuf), 20, 20, color);
map.b = 255; map.r = map.g = 0;
color = ggiMapColor(*(colorBuf), &map);
ggiPutPixel(*(colorBuf), 100, 100, color);
If these lines followed each other in code, I would get a plotted point
in the respective areas of the separate visuals (as I understand it).
This is NOT happening for me. What have I forgotten? I can draw to
screenBuf perfectly fine. However, I start colorBuf after the user
presses a key sequence and then try to display three bars for RGB value
sliders. They don't appear. I can not write text (ggiPuts) to the
colorBuf either. I have looked at the API and tried to find the answer
on my own. I suspect it is a simple thing I have overlooked.
Thanks
RDB