[gtkmm] gtkmm graphics questions
- From: Jussi Pakkanen <jpakkane yahoo com>
- To: gtkmm-list gnome org
- Subject: [gtkmm] gtkmm graphics questions
- Date: Tue, 6 Aug 2002 01:54:48 -0700 (PDT)
Hi all
I have been coding a Doom level editor for id
Software's Doom game with gtkmm 1.2. Currently the
editor runs on Linux and Windows and has all kinds of
stuff, such as Python scripting. You can check it out
here:
http://www.hut.fi/~jpakkane/why/
(Beware, some of the menus are ghastly. This is my
first GUI project. ;) )
Anyhow, I have run into some problems when coding
graphics, colormaps and related things. Specifically:
gtkmm's (as well as gtk's) documentation on colormaps
(http://gtkmm.sourceforge.net/gtkmm2/tutorial/html/ch12.html)
is somewhat confusing. If you open a new window, must
you reallocate colors in it or can you use the same
colormap as some other window? Once you have allocated
the colors you want, can you deallocate the Colormap
object or must you store it for the lifetime of the
window/application?
I know I have allocated black color to my colormap.
When I create Gdk::Pixmaps I set their background to
black with gc.set_foreground(Gdk_Color("black")) and
draw_rectagle. Then I compose the actual graphics on
another pixmap with draw_pixmap. I then blit this to
the screen when I get an expose event. However the
color that should be black can be anything on screen:
yellow, green, gray, etc (on Windows it is black). I
also get lots of failed assertions on GdkPixmaps, but
the program still works. If I blit the original
pixmaps to a drawing area, the black color shows as
black.
How can I make the graphics work better? GdkRGB seems
like a good idea, it's not wrapped according to
gtkmm's docs. Will it get wrapped soon? I wouldn't
want to code it now with GTK and later recode it using
gtkmm.
If some of these things can be easily fixed by porting
to version 2 just tell me how it works in gtkmm2. I'll
port the program to gtkmm2 once both Linux and Windows
versions are stable.
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]