Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Lowest Level of Graphics on Windows

Lowest Level of Graphics on Windows

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestionwinformsjsonlearning
11 Posts 5 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Captain Price

    I have been working on GDI previously. It is fine, but all the graphics libraries including GDI have limits. Eg:- Let's say you want to create a gradient with GDI (or any other API), of course they're pre-defined functions for you to use. But What if I want to create my own function for a gradient effect. Maybe with the SetPixel() function. But those APIs (GDI, GDI+ ....) are high level APIs. Creating such effects with a high level library slows down the program (because, there's a long pipeline from a GDI call to the Graphics Card). So, What is the lowest possible level of graphics programming on Windows ? Can I program directly to the GPU ? Or Are there any low level Graphics libraries available on Windows ?

    CPalliniC Online
    CPalliniC Online
    CPallini
    wrote on last edited by
    #2

    I suppose DirectX[^] is your best bet: you might choose Direct2D[^] or DirectDraw[^], depending on your needs.

    Veni, vidi, vici.

    In testa che avete, signor di Ceprano?

    C 1 Reply Last reply
    0
    • CPalliniC CPallini

      I suppose DirectX[^] is your best bet: you might choose Direct2D[^] or DirectDraw[^], depending on your needs.

      Veni, vidi, vici.

      C Offline
      C Offline
      Captain Price
      wrote on last edited by
      #3

      yeaaah... It's a pretty good library for Graphics. But it's probably not the one I'm looking for, i guess. Alright, then, What's under DirectX or GDI or etc.. On what environments are those APIs on ?

      CPalliniC 1 Reply Last reply
      0
      • C Captain Price

        yeaaah... It's a pretty good library for Graphics. But it's probably not the one I'm looking for, i guess. Alright, then, What's under DirectX or GDI or etc.. On what environments are those APIs on ?

        CPalliniC Online
        CPalliniC Online
        CPallini
        wrote on last edited by
        #4

        Pravinda Amarathunge wrote:

        What's under DirectX or GDI or etc

        See DirectDraw Architecture (Windows Drivers)[^] for a nice drawing.

        Veni, vidi, vici.

        In testa che avete, signor di Ceprano?

        C 1 Reply Last reply
        0
        • CPalliniC CPallini

          Pravinda Amarathunge wrote:

          What's under DirectX or GDI or etc

          See DirectDraw Architecture (Windows Drivers)[^] for a nice drawing.

          Veni, vidi, vici.

          C Offline
          C Offline
          Captain Price
          wrote on last edited by
          #5

          Well, that seems a nice one :) Thanks

          Pravinda

          1 Reply Last reply
          0
          • C Captain Price

            I have been working on GDI previously. It is fine, but all the graphics libraries including GDI have limits. Eg:- Let's say you want to create a gradient with GDI (or any other API), of course they're pre-defined functions for you to use. But What if I want to create my own function for a gradient effect. Maybe with the SetPixel() function. But those APIs (GDI, GDI+ ....) are high level APIs. Creating such effects with a high level library slows down the program (because, there's a long pipeline from a GDI call to the Graphics Card). So, What is the lowest possible level of graphics programming on Windows ? Can I program directly to the GPU ? Or Are there any low level Graphics libraries available on Windows ?

            A Offline
            A Offline
            Albert Holguin
            wrote on last edited by
            #6

            GDI is actually pretty low-level... not sure what you're trying to accomplish (overall) but maybe you're doing something wrong if GDI is too slow. Remember that you can draw off screen then transition that over to the screen, that method is blazing fast.

            C 1 Reply Last reply
            0
            • A Albert Holguin

              GDI is actually pretty low-level... not sure what you're trying to accomplish (overall) but maybe you're doing something wrong if GDI is too slow. Remember that you can draw off screen then transition that over to the screen, that method is blazing fast.

              C Offline
              C Offline
              Captain Price
              wrote on last edited by
              #7

              Never heard about a such thing before, but soundly cool. Any clue of how to ? :omg:

              A O 2 Replies Last reply
              0
              • C Captain Price

                I have been working on GDI previously. It is fine, but all the graphics libraries including GDI have limits. Eg:- Let's say you want to create a gradient with GDI (or any other API), of course they're pre-defined functions for you to use. But What if I want to create my own function for a gradient effect. Maybe with the SetPixel() function. But those APIs (GDI, GDI+ ....) are high level APIs. Creating such effects with a high level library slows down the program (because, there's a long pipeline from a GDI call to the Graphics Card). So, What is the lowest possible level of graphics programming on Windows ? Can I program directly to the GPU ? Or Are there any low level Graphics libraries available on Windows ?

                S Offline
                S Offline
                Shaheed Legion
                wrote on last edited by
                #8

                The lowest level API that you can work with, while still using GDI, is DIBSections. DIBSections allow you to update the pixels of a bitmap manually and draw that bitmap using an HDC. They have always been fast enough, and are many times faster than using the SetPixel method. Hope this helps.

                For awesome websites or just to chat check out my blog for more info. . .

                1 Reply Last reply
                0
                • C Captain Price

                  Never heard about a such thing before, but soundly cool. Any clue of how to ? :omg:

                  A Offline
                  A Offline
                  Albert Holguin
                  wrote on last edited by
                  #9

                  BitBlt() is the function that does the move (commonly referred to as "bit blitting")... so just look up methods of using that effectively.

                  C 1 Reply Last reply
                  0
                  • A Albert Holguin

                    BitBlt() is the function that does the move (commonly referred to as "bit blitting")... so just look up methods of using that effectively.

                    C Offline
                    C Offline
                    Captain Price
                    wrote on last edited by
                    #10

                    ooh the Memory DC, it's useful :thumbsup:

                    1 Reply Last reply
                    0
                    • C Captain Price

                      Never heard about a such thing before, but soundly cool. Any clue of how to ? :omg:

                      O Offline
                      O Offline
                      Orjan Westin
                      wrote on last edited by
                      #11

                      The technique is called double buffering. There are a lot of tips on how to do it with GDI+ here.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups