SurfaceLoader dx9 c#

Rakka Rage

Newcomer
Joined
May 22, 2003
Messages
6
Location
Toronto, ON, Canada
i am trying to load a cursor from a stream with Color.Red being
transparent...

SurfaceLoader.FromStream(_surface, RS("Cursor.bmp"), Filter.None,
Color.Red.ToArgb());

but all the SurfaceLoader.FromStream methods take an existing Surface
unlike the TextureLOader.FromStream methods which return a texture...

so what am i supposed to do? make a new surface first?

there are no empty contructors for Surface the only one that seems to
work is

_surface = new Surface(_d3dd, RS("Cursor.bmp"), Pool.Default);

which basically does the same thing as the SurfaceLoader.FromStream
except making the Color.Red transparent... so i have to "load" the
suface twice to achieve this??? if only SurfaceLoader.FromStream
returned the new Surface instead of taking it as a parameter...

or am i doing it wrong? use TextureLoader?
 
i wish there was an "empty" constructor...

public Surface (Device, Stream, Pool)
public Surface (Device, Bitmap, Pool)
public Surface (IntPtr, Object)

those are my choices... i tried using the IntPtr one passing in IntPtr.Zero but then it just throws an object disposed exception when i call SurfaceLoader from stream...

so i guess i have to use the stream constructor to create the surface then seek the stream back and then use SurfaceLoader to read the same stream into the same object to make the Color.Red transparent...

it also seems to crash if i try to use Pool.Managed for my cursor... but i guess that is a whole other issue...

anyone else use the SetCursorProperties in dx9 c#? how did you do it?
 
Back
Top