Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Restore system colors

Posted on 1997-09-10
5
Medium Priority
?
152 Views
Last Modified: 2013-12-26
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
0
Comment
Question by:lindner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:lindner
ID: 1294893
Adjusted points to 100
0
 

Author Comment

by:lindner
ID: 1294894
Adjusted points to 125
0
 
LVL 3

Expert Comment

by:EricKaplan
ID: 1294895
Use a pallete for the application instead of the system's
-Eric.
0
 

Author Comment

by:lindner
ID: 1294896
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

0
 
LVL 3

Accepted Solution

by:
EricKaplan earned 120 total points
ID: 1294897
Check out any book which deals tith CGL/XVIEW/XLIB, any of them
should have the code/example/instructions about how to work, define and switch between palettes.

-Eric.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question