Notices

Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

Drawing to the screen itself via GTK

Post Reply New Thread Subscribe Search this Thread
 
 
Thread Tools
Old 06-10-09, 10:12 AM Thread Starter   #1
Kibokun
Member

 
Kibokun's Avatar 

Join Date: Mar 2006

 
Drawing to the screen itself via GTK


I'm trying to figure out a way using GTK+ (or any GNOME windowing toolkit module) to draw directly to the screen, not bound by a widget. For the simplest of effects, I just want to make the entire screen flash red and fade back to a normal R value, but I don't quite understand what I'd need to use to do this as all the drawing functions I've found have been for drawing to a drawable object. Any information / guides / tips would be helpful. I'm writing this in C, by the way.

Thanks!

__________________
Asus P8P67 PRO Rev 3.0
Corsair 650TX 650W PSU
Intel Core i5-2500k
Sapphire Radeon 7850
8GB Corsair Vengeance 1600Mhz
Raidmax Smilodon
WD Caviar 500GB
HP 2311Xi
Kibokun is offline   QUOTE Thanks
Old 06-10-09, 02:52 PM   #2
Chris_F
Member

 
Chris_F's Avatar 

Join Date: Jun 2003
Location: Columbus, Ohio

10 Year Badge
 
Quote:
Originally Posted by Kibokun View Post
I'm trying to figure out a way using GTK+ (or any GNOME windowing toolkit module) to draw directly to the screen, not bound by a widget. For the simplest of effects, I just want to make the entire screen flash red and fade back to a normal R value, but I don't quite understand what I'd need to use to do this as all the drawing functions I've found have been for drawing to a drawable object. Any information / guides / tips would be helpful. I'm writing this in C, by the way.

Thanks!
You mean draw to the entire screen and not just your application window? Can't be done like that. You either need your program window to fill up the entire screen, or you need to use X to write directly to the screen buffer.

__________________

CPU: Intel Core i5 750 @ 4.0GHz 200x20
Motherboard: MSI P55-GD65 LGA 1156
Memory: OCZ Platinum DDR3 1600 7-7-7-20 8GB
Graphics: ATI Radeon HD 5850 @ 950MHz/1125MHz
HDD: Western Digital 4x160GB 7200RPM Matrix RAID 10
OS: Windows 7 x64
Chris_F is offline   QUOTE Thanks
Old 06-10-09, 03:34 PM Thread Starter   #3
Kibokun
Member

 
Kibokun's Avatar 

Join Date: Mar 2006

 
hmm, that's annoying. My team doesn't really have time to learn Xlib for this project. Does GDK offer any sort of medium between xlib and GTK? I've been reading up on GDKScreens and modifying ColorMaps, but I don't know if this is the way it should be done.

A compromise we've been talking about is making a GTK widget that isn't attached to a window somehow. Or maybe making a GTK window that's transparent so only things drawn to it appear? I will have to fiddle I guess.

Thanks!

__________________
Asus P8P67 PRO Rev 3.0
Corsair 650TX 650W PSU
Intel Core i5-2500k
Sapphire Radeon 7850
8GB Corsair Vengeance 1600Mhz
Raidmax Smilodon
WD Caviar 500GB
HP 2311Xi
Kibokun is offline   QUOTE Thanks
Old 06-10-09, 04:00 PM   #4
JigPu
Inactive Pokémon Moderator

 
JigPu's Avatar 

Join Date: Jun 2001
Location: Vancouver, WA

10 Year Badge
 
I haven't done any GTK programming, but I'd imagine all widgets have to be attached to a window. What I think I'd do in your situation (again, without having done any GTK before) is to create a new window just for this effect. This new window would be set to have no decoration (title bar, minimize/restore/close buttons, etc) and fill the screen. Then draw either directly to the window or to a widget filling the window.

A window without decoration looks like nothing more than the widget contained (or background graphics if you can directly draw to a window) and should work well unless you're planning on doing something more complex...

JigPu

__________________
.... ASRock Z68 Extreme3 Gen3
.... Intel Core i5 2500 ........................ 4 thread ...... 3300 MHz ......... -0.125 V
2x ASUS GTX 560 Ti ............................... 1 GiB ....... 830 MHz ...... 2004 MHz
.... G.SKILL Sniper Low Voltage ............. 8 GiB ..... 1600 MHz ............ 1.25 V
.... OCZ Vertex 3 ................................. 120 GB ............. nilfs2 ..... Arch Linux
.... Kingwin LZP-550 .............................. 550 W ........ 94% Eff. ....... 80+ Plat
.... Nocuta NH-D14 ................................ 20 dB ..... 0.35 C°/W ................ 7 V


"In order to combat power supply concerns, Nvidia has declared that G80 will be the first graphics card in the world to run entirely off of the souls of dead babies. This will make running the G80 much cheaper for the average end user."
"GeForce 8 Series." Wikipedia, The Free Encyclopedia. 7 Aug 2006, 20:59 UTC. Wikimedia Foundation, Inc. 8 Aug 2006.
JigPu is offline   QUOTE Thanks
Old 06-11-09, 12:37 AM   #5
ShadowPho
Member

 
ShadowPho's Avatar 

Join Date: Jun 2005
Location: I am in your stack, SUBbing your registers!

 
A dirty hack: an openGL program that runs in the background, receives a signal, creates a fullscreen window on the fly, maximizes and then self destructs.

__________________
"Take only that which you can give"
Need Help? IM me! I want to help the OC community!

MainComputer:
E6400@2.69-4.0 gig RAM-8800GT
ASUS P5N-E SLI

ShadowPho is offline Heatware Profile   QUOTE Thanks

Post Reply New Thread Subscribe


Overclockers Forums > Software > Programming Tips and Tricks
Programming Tips and Tricks
Forum Jump

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Mobile Skin
All times are GMT -5. The time now is 01:51 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
You can add these icons by updating your profile information to include your Heatware ID, Benching Profile ID or your Folding/SETI profile ID. Edit your profile!
X

Welcome to Overclockers.com

Create your username to jump into the discussion!

New members like you have made this the best community on the Internet since 1998!


(4 digit year)

Why Join Us?

  • Share experience
  • Max out your hardware
  • Best forum members anywhere
  • Customized forum experience

Already a member?