예제 #1
0
        public SDL_FontSurface(SDL_Display owner, System.Drawing.Font font)
        {
            // TODO: Fix this somehow.
            mFont = new SdlDotNet.Font(@"C:\Windows\Fonts\micross.ttf", (int)(font.SizeInPoints + 0.5));

            mOwner      = owner;
            mBackBuffer = mOwner.BackBuffer;

            mSprite = new SdlDotNet.Sprites.TextSprite("text", mFont);
        }
예제 #2
0
        public override void Dispose()
        {
            if (mSurface != null)
            {
                mSurface.Dispose();
            }

            mOwner      = null;
            mSurface    = null;
            mBackBuffer = null;
        }
예제 #3
0
        public SDL_Surface(SDL_Display owner, Size surfaceSize)
        {
            mOwner      = owner;
            mBackBuffer = mOwner.BackBuffer;

            mSurface = new SdlDotNet.Surface(surfaceSize);
            mSurface = mSurface.Convert(owner.BackBuffer);

            //mSurface.TransparentColor = Color.FromArgb(255, 255, 0, 255);

            mSurface.AlphaBlending = true;
        }
예제 #4
0
        public SDL_Surface(SDL_Display owner, string fileName)
        {
            mOwner      = owner;
            mBackBuffer = mOwner.BackBuffer;

            mSurface = new SdlDotNet.Surface(fileName);

            mSurface.AlphaBlending = true;
            mSurface.Alpha         = 255;


            //BlankTransparentPixels();
        }
예제 #5
0
        public override void Dispose()
        {
            if (mFont != null)
            {
                mFont.Dispose();
            }
            if (mSprite != null)
            {
                mSprite.Dispose();
            }

            mOwner      = null;
            mFont       = null;
            mBackBuffer = null;
            mSprite     = null;
        }
예제 #6
0
        public override bool Initialize(DisplayInitInfo displayType)
        {
            SDL.Video.Initialize();

            mParent = displayType.Parent;

            if (displayType.FullScreen)
            {
                SDL.Video.SetVideoMode(displayType.Width, displayType.Height, displayType.BPP);
            }
            else
            {
                displayType.Width  = mParent.ClientRectangle.Width;
                displayType.Height = mParent.ClientRectangle.Height;
            }

            mBackBuffer = new SDL.Surface(displayType.Width, displayType.Height);

            return(true);
        }
예제 #7
0
 public SDL_Canvas(SDL.Surface surface)
 {
     mSurface = surface;
 }
예제 #8
0
 // HACK:
 public void MakeCompatibleWidth(SDL_Surface surf)
 {
     mSurface = mSurface.Convert(surf.SDLSurface);
     mSurface.AlphaBlending = true;
 }