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#
  4. Managed DirectDraw

Managed DirectDraw

Scheduled Pinned Locked Moved C#
c++comgraphicsgame-devdata-structures
1 Posts 1 Posters 0 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.
  • T Offline
    T Offline
    Tomas Petricek
    wrote on last edited by
    #1

    Hi, I'm trying to direct acces to MDDraw surface memory. I'm using Lock() method but I don't understand it. I was doing same thing in C++ and DX7.. Unmanaged Lock() returns pointer to memory and informations about format, but managed Lock() returns 2-dimensional array of byte (width and height of this array is same as size of the surface, but this is not enough for saving color in 32bit format). Following code does nothing: :~

    Byte[,] btData=surfaceBack.Lock(LockFlags.SurfaceMemoryPointer|LockFlags.Wait);
    for(int x=0; x<100; x++)
    {
    for (int y=0; y<100; y++)
    {
    btData[x,y]=(byte)x;
    }
    }
    srfBack.Unlock(btData);

    :confused: Thank you for help. [edit]:| MSDN : Surface.Lock()http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_m/directx/ref/ns/microsoft.directx.directdraw/c/surface/m/lock0.asp[^][/edit] i'm only pointer to myself

    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