Results 1 to 5 of 5
  1. #1

    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

  2. #2
    Member Chris_F's Avatar
    10 Year Badge
    Join Date
    Jun 2003
    Location
    Columbus, Ohio
    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: MSI GeForce GTX 760 @ 1215MHz/3206MHz
    HDD: Western Digital Caviar Black 500GB, Toshiba 3.0TB
    OS: Windows 7 x64

  3. #3
    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

  4. #4
    Inactive Pokémon Moderator JigPu's Avatar
    10 Year Badge
    Join Date
    Jun 2001
    Location
    Vancouver, WA
    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.

  5. #5
    Member ShadowPho's Avatar
    Join Date
    Jun 2005
    Location
    I am in your stack, SUBbing your registers!
    Heatware Profile
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •