Direct Draw Windowed ?
Direct Draw Windowed ?
Direct Draw Windowed ?
Direct Draw Windowed ?
Direct Draw Windowed ?
Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ?
Direct Draw Windowed ? Direct Draw Windowed ?
Direct Draw Windowed ?
Go Back  Xtreme Visual Basic Talk > > > > Direct Draw Windowed ?


Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2005, 09:25 AM
Maddy Maddy is offline
Newcomer
 
Join Date: Apr 2005
Posts: 4
Default Direct Draw Windowed ?


Im currently working on a DirectDraw engine. It works so far, but i'd really like to have the Graphics drawn to a special area on a Window instead of making it fullscreen. How can i initialize the Device so it will draw to a window instead ?

Code:
Public Sub InitializeGraphics()

        '// Now we’ll tell the graphics card to give our window (Me) fullscreen control.
        GraphicsCard.SetCooperativeLevel(Me, CooperativeLevelFlags.FullscreenExclusiveAllowModex)
        '// Set display width, height, color depth (in bits), and refresh rate (0 = default, and safest)
        GraphicsCard.SetDisplayMode(640, 480, 16, 60, False)

        description = New SurfaceDescription
        '// The SurfaceDescription object will be used to describe the primary surface to DirectX
        '// Now we describe the primary surface:
        description.SurfaceCaps.PrimarySurface = True 'This is a primary surface.
        description.SurfaceCaps.Flip = True        'This surface can be flipped.	
        description.SurfaceCaps.Complex = True 'This is a complex surface (since it will have a backbuffer)
        description.BackBufferCount = 1          'This surface will have one backbuffer.

        '// Here we set the primary surface up
        primary = New Surface(description, GraphicsCard)
        'Give it the description and attach it to the GraphicsCard object.
        'We will now set the capabilities of the backbuffer. 
        Dim caps As New SurfaceCaps 'Makes a new Surface capabilities object.
        caps.BackBuffer = True 'This sets the caps object to give backbuffer capability.
        '// The following will attach the backbuffer to the primary object.
        backbuffer = primary.GetAttachedSurface(caps)

        '// Create the sprite bitmap surface.
        sprite = New Surface("tileset.bmp", New SurfaceDescription, GraphicsCard)
        'A blank SurfaceDescription suffices.

        '// we will now make all black areas of the sprite be transparent
        Dim ck As ColorKey = New ColorKey
        sprite.SetColorKey(ColorKeyFlags.SourceDraw, ck) 'You can specify a color, but it defaults to black

        'Release all of our temporary objects.	
        description = Nothing
        caps = Nothing
        ck = Nothing
    End Sub '// This is the end of our InitializeGraphics Subroutine
Reply With Quote
  #2  
Old 04-20-2005, 01:24 AM
ardman ardman is offline
Contributor
 
Join Date: Jan 2002
Posts: 126
Default

Dont you change the line:
Code:
GraphicsCard.SetCooperativeLevel(Me, CooperativeLevelFlags.FullscreenExclusiveAllowModex)
and not put it full screen?
__________________
Cheers
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Direct Draw Windowed ?
Direct Draw Windowed ?
Direct Draw Windowed ? Direct Draw Windowed ?
Direct Draw Windowed ?
Direct Draw Windowed ?
Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ? Direct Draw Windowed ?
Direct Draw Windowed ?
Direct Draw Windowed ?
 
Direct Draw Windowed ?
Direct Draw Windowed ?
 
-->