Randall <[EMAIL PROTECTED]> writes:

> 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);
>     .
>     .
>     .
> }

Highly weird code... You'd want to do:

ggi_visual_t screenBuf;
ggi_visual_t colorBuf;

void main(void)
{

    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);

This is all black.

>     ggiPutPixel(*(screenBuf), 20, 20, color);
>     map.b = 255; map.r = map.g = 0;

This is also black on practicly all supported hardware.
You don't happen to mean map.b = 65535; map.r = map.g ?

> 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).

Correct.

> 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.

Your code works just fine for me after changing the colors to something
else than black, so I have no idea what your problem can be. If you'd
like to send me a compilable test case that fails for you I'd be
happy to have a look at it.

//Marcus
-- 
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan
 Royal Institute of Technology |       Phone: +46 707 452062
       Stockholm, Sweden       |   E-Mail: [EMAIL PROTECTED]

Reply via email to