bool isWire = true;
...
if (isWire) {
glPolygonMode(GL_FRONT, GL_LINE);
glPolygonMode(GL_BACK, GL_LINE);
}
...(draw)...
glPolygonMode(GL_FRONT, GL_FILL);
glPolygonMode(GL_BACK, GL_FILL);
Sunday, November 23, 2008
Wireframe mode in OpenGL
Here's an easy way to have a togglable wireframe mode in OpenGL (useful for debuging):
Sunday, November 2, 2008
xrandr for external windows (thinkpad t61)
For reference, here are my bash aliases for setting up external monitors on my Thinkpad T61:
LVDS: internal screen
VGA: DSUB (blue) (on left of laptop or a dock)
TMDS-1: DVI (white) (on a dock)
lcd: one external monitor (the DSUB slot on the left)
dual_lcd: two external monitors (via a dock)
internal: just the internal screen
Note: Only two screens can be active at once (you'll get an error if you try to add a third; that's why the shortcuts are so complicated)
alias lcd='xrandr --addmode VGA 1280x1024 && xrandr --output LVDS --auto && xrandr --output VGA --mode 1280x1024 --left-of LVDS'
alias internal='xrandr --output VGA --off && xrandr --output TMDS-1 --off && xrandr --output LVDS --auto'
alias dual_lcd='xrandr --output LVDS --off && xrandr --output VGA --mode 1280x1024 && xrandr --output TMDS-1 --mode 1280x1024 --left-of VGA'
LVDS: internal screen
VGA: DSUB (blue) (on left of laptop or a dock)
TMDS-1: DVI (white) (on a dock)
lcd: one external monitor (the DSUB slot on the left)
dual_lcd: two external monitors (via a dock)
internal: just the internal screen
Note: Only two screens can be active at once (you'll get an error if you try to add a third; that's why the shortcuts are so complicated)
Making your own programs float in awesome window manager
I do a fair bit of graphics/game coding in my spare time (and occasionally for classes). These don't fit well into tiling environments, since I usually want them to be a specific resolution, and in-front of all other windows. Fortunately, there's an easy way to do this with the awesome window manager (note: this is with version 2.3).
The normal way of making things float in awesome is like this:
However, this didn't work so well for my stuff. I tried variations of a.out (which I swore I got to work before...wish I'd backed up that conf file...) to no avail. However, you can also use xproperties, obtainable from xprop (run xprop in a terminal, click on the window you want info for, and the x properties will be printed in the terminal).
For my current project, this gave me:
In the
It worked! (A bit tedious to add for each new app you work on, but better than nothing for now....I'll update post if I figure out how my old a.out trick worked).
The normal way of making things float in awesome is like this:
rule { name = "Gimp" float = true }
However, this didn't work so well for my stuff. I tried variations of a.out (which I swore I got to work before...wish I'd backed up that conf file...) to no avail. However, you can also use xproperties, obtainable from xprop (run xprop in a terminal, click on the window you want info for, and the x properties will be printed in the terminal).
For my current project, this gave me:
$ xprop
WM_STATE(WM_STATE):
window state: Normal
icon window: 0x0
_AWESOME_PROPERTIES(STRING) = "0010000000"
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW
WM_LOCALE_NAME(STRING) = "C"
WM_HINTS(WM_HINTS):
Initial state is Normal State.
WM_NORMAL_HINTS(WM_SIZE_HINTS):
user specified location: 100, 100
user specified size: 800 by 600
WM_CLIENT_MACHINE(STRING) = "Gecko"
WM_ICON_NAME(STRING) = "Asteroid Game"
WM_NAME(STRING) = "Asteroid Game"
In the
rules
section of ~/.awesomerc
, I added the following:
rule {xproperty_name = "WM_NAME" xproperty_value="Asteroid Game" float = true }
It worked! (A bit tedious to add for each new app you work on, but better than nothing for now....I'll update post if I figure out how my old a.out trick worked).
Saturday, November 1, 2008
Some good trayer flags
While good documentation is hard to find for Linux in general, it's almost non-existent for smaller, less used (read: non-gnome/kde) apps. One such app is
Here is a spiffy example of trayer usage that I found (tested in xmonad):
trayer
, which gives you a stand alone system tray (for icons of apps like pidgin, gmail notifier, and the like). It's especially useful for minimalistic window managers that don't come with panels (such as wmii, awesome wm, or xmonad).Here is a spiffy example of trayer usage that I found (tested in xmonad):
trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 10 --transparent true --tint 0x191970 --height 12
Subscribe to:
Posts (Atom)