lindner
asked on
Restore system colors
Hi,
I'm programming an application on Solaris (Sun Sparcstation) that draws 3D-Polygons by use of XGL, XVIEW and XLIB.
In order to visualize additional information I switch from one LUT to the next as fast as possible (several times per second). This works fine, but when my program quits the system-colors will not be restored so that the desktop remains in strange colors.
I intend to read out the current LUT when my program starts and to restore these colors when my program quits, but I still have problems reading out the current LUT at startup. The problem may be that the desktop is in RGB-Mode so that there is no 8bit-LUT in use.
The used graphics accelerator Leo ZX supports
2*24bit double buffered graphics
24bit Z-Buffer
8bit Overlay
10bit Window-ID
6bit fast clear
Initialization-Phase:
Xgl_color lut[256];
...
canvas = (Canvas) xv_create(frame, CANVAS, WIN_DEPTH, 8, XV_VISUAL_CLASS, 3, NULL);
win_ras = xgl_object_create(sys_st, ..., XGL_DEV_COLOR_TYPE, XGL_COLOR_INDEX, NULL);
The routine set_lut():
cmap_info.colors = lut;
xgl_object_set(cmap, XGL_CMAP_COLOR_TABLE, &cmap_info, NULL);
xgl_object_set(win_ras, XGL_DEV_COLOR_MAP, cmap, NULL);
Does anybody has an idea how to restore the system-colors when my program quits?
Thanks, M. Lindner
I'm programming an application on Solaris (Sun Sparcstation) that draws 3D-Polygons by use of XGL, XVIEW and XLIB.
In order to visualize additional information I switch from one LUT to the next as fast as possible (several times per second). This works fine, but when my program quits the system-colors will not be restored so that the desktop remains in strange colors.
I intend to read out the current LUT when my program starts and to restore these colors when my program quits, but I still have problems reading out the current LUT at startup. The problem may be that the desktop is in RGB-Mode so that there is no 8bit-LUT in use.
The used graphics accelerator Leo ZX supports
2*24bit double buffered graphics
24bit Z-Buffer
8bit Overlay
10bit Window-ID
6bit fast clear
Initialization-Phase:
Xgl_color lut[256];
...
canvas = (Canvas) xv_create(frame, CANVAS, WIN_DEPTH, 8, XV_VISUAL_CLASS, 3, NULL);
win_ras = xgl_object_create(sys_st, ..., XGL_DEV_COLOR_TYPE, XGL_COLOR_INDEX, NULL);
The routine set_lut():
cmap_info.colors = lut;
xgl_object_set(cmap, XGL_CMAP_COLOR_TABLE, &cmap_info, NULL);
xgl_object_set(win_ras, XGL_DEV_COLOR_MAP, cmap, NULL);
Does anybody has an idea how to restore the system-colors when my program quits?
Thanks, M. Lindner
ASKER
Adjusted points to 125
Use a pallete for the application instead of the system's
-Eric.
-Eric.
ASKER
Hi Eric,
the question is: HOW can I do that? And HOW can I switch back to the system's palette when my program quits? Shall I use functions of XGL, XVIEW or XLIB for this? I already tried lots of ways, but up to today without success.
Yours, Lindner
the question is: HOW can I do that? And HOW can I switch back to the system's palette when my program quits? Shall I use functions of XGL, XVIEW or XLIB for this? I already tried lots of ways, but up to today without success.
Yours, Lindner
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER