Thread: Yes- I'm complaining about DirectX

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001
    Posts
    937

    Yes- I'm complaining about DirectX

    I have read a number of tutorials on DirectX, but there is always one thing holding me back from grasping the API. What (exacly, technically, and realistically) is a surface?
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    Ecologist
    Join Date
    Aug 2001
    Location
    Utah.
    Posts
    1,291
    They represent areas of memory that hold graphics. The following
    explanation is from "Tricks of the Windows Game Programming
    Gurus."


    They're rectangular regions of memory that can hold bitmap data.
    There are two kinds of surfaces: primary and secondary. A
    Primary Surface directly corresponds to the actual video memory
    being rasterized by the video card and is visible at all times. Hence,
    you will only have one primary surface, and it refers directly to the
    screen image and usually resides in VRAM. When you manipulate
    it, you see the results instantly on the screen. If you set the
    video mode to 640x480x256, you must create a primary surface
    that is also 640x480x456 and then attach it to the display device.



    So, you have a primary surface that represents the screen; then
    you can have a secondary surface that acts as a double buffer
    that you draw to, then copy to the primary surface. Or you can
    use a secondary surface to hold your actual bitmaps images,
    this way you can use hardware acceleration on your graphics.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    648
    A surface is just a great block of data thats filled with image data. Depending on how its used or where it is, it can be hardware accelerated. Thats about it.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    For some reason MS always feels the need to invent a new dictionary every time they program an API or application. There is an 'official' name for everything - but don't let it scare you - once you get past the semantics the API is very easy to use.

    But, I feel your pain.



  5. #5
    primary surfaces don't always represent JUST the screen.

    *All hail OpenGL*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with my DirectX program
    By fighter92 in forum Game Programming
    Replies: 1
    Last Post: 01-23-2007, 06:28 PM
  2. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  3. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM
  4. DirectX - Starting Guide?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-25-2004, 12:49 AM
  5. Directx SDK Documentation
    By Zoalord in forum Game Programming
    Replies: 4
    Last Post: 05-08-2003, 06:07 AM