Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Full screen on directx8 eclipse origins


piscometro
 Share

Recommended Posts

Hi, i searched the forum for psot related with fullscreen, but none of them was for the directx8 eclipse origins. Can someone help me on this, and give me some tips? I searched the code for windowed, and change that to false, but a error happier in loggin screen. Ty for the help ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)
Link to comment
Share on other sites

[]([url]http://directx4vb.vbgamer.com/DirectX4VB/Tutorials/DirectX8/GR_Lesson01.asp[/url])[http://directx4vb.vbgamer.com/DirectX4VB/Tutorials/DirectX8/GR_Lesson01.asp](http://directx4vb.vbgamer.com/DirectX4VB/Tutorials/DirectX8/GR_Lesson01.asp)

at the end of the page it tells you how to configure for fullscreen
Link to comment
Share on other sites

Try

DispMode.Format = D3DFMT_X8R8G8B8

DispMode.Width = 800

DispMode.Height = 600

D3Dwindow.SwapEffect = D3DSWAPEFFECT_FLIP

D3Dwindow.BackBufferCount = 1 '//1 backbuffer only

D3Dwindow.BackBufferFormat = DispMode.Format 'What we specified earlier

D3Dwindow.BackBufferHeight = 600

D3Dwindow.BackBufferWidth = 800

D3Dwindow.hDeviceWindow = frmMain.hWnd

I wouldnt reccomend it this way, I would get the user resolution first and then adjust the game screen based on the resolution, but that would streatch everything depending on the the persons resolution.

Maybe have a couple of options available and let the user decide which one works the best for them.
Link to comment
Share on other sites

Direct3D.GetAdapterDisplayMode D3DADAPTER_DEFAULT, Display_Mode 'Use the current display mode that you

'are already on. Incase you are confused, I'm

'talking about your current screen resolution. ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)

Direct3D_window.Windowed = False 'The app will be in windowed mode.

Direct3D_window.BackBufferFormat = D3DFMT_X8R8G8B8

Direct3D_window.SwapEffect = D3DSWAPEFFECT_DISCARD 'Refresh when the monitor does.

Direct3D_window.BackBufferFormat = Display_Mode.Format 'Sets the format that was retrieved into the backbuffer.

Direct3D_window.BackBufferCount = 1 '1 backbuffer only

Direct3D_window.BackBufferWidth = 800 ' frmMain.picScreen.ScaleWidth 'Match the backbuffer width with the display width

Direct3D_window.BackBufferHeight = 600 'frmMain.picScreen.ScaleHeight 'Match the backbuffer height with the display height

Direct3D_window.hDeviceWindow = frmMain.picScreen.hWnd 'Use frmMain as the device window.

I have this code, but it fails to create device, can someone help?
Link to comment
Share on other sites

```

' Stop us from going ahead if it's minimised..

If frmMain.WindowState = vbMinimized Then Exit Sub

MAX_MAPX = RoundUpTo32(frmMain.ScaleWidth) / 32 - 1

MAX_MAPY = RoundUpTo32(frmMain.ScaleHeight) / 32 - 1

HalfX = ((MAX_MAPX + 1) / 2) * PIC_X

HalfY = ((MAX_MAPY + 1) / 2) * PIC_Y

ScreenX = (MAX_MAPX + 1) * PIC_X

ScreenY = (MAX_MAPY + 1) * PIC_Y

If Fullscreen = True Then

ActualX = TwipsToPixels(Screen.Width, 0)

ActualY = TwipsToPixels(Screen.Height, 1)

Else

ActualX = Me.ScaleWidth

ActualY = Me.ScaleHeight

End If

StartXValue = ((MAX_MAPX + 1) / 2) - 1

StartYValue = ((MAX_MAPY + 1) / 2) - 1

EndXValue = (MAX_MAPX + 1) + 1

EndYValue = (MAX_MAPY + 1) + 1

Direct3D_window.BackBufferWidth = frmMain.ScaleWidth 'Match the backbuffer width with the display width

Direct3D_window.BackBufferHeight = frmMain.ScaleHeight 'Match the backbuffer height with the display height

Direct3D_Device.Reset Direct3D_Window

DirectX_ReInit
```

That is literally all I use in my resizing code for resolutions and fullscreen (Although, you have to keep in mind that I have stuff drawing to the form, not to the picScreen, and I changed all of the camera constants to variables. I also did a few other things that I can't remember, but this should provide a good base ;>). That's in the Form_Resize procedure.
Link to comment
Share on other sites

Oh, and you may want these procedures…

```

Public Function RoundUpTo32(ByVal Number As Long) As Long

RoundUpTo32 = CLng(Number / 32) * 32

End Function

Public Sub SetResolution(ByVal Width As Long, ByVal Height As Long)

frmMain.WindowState = vbNormal

'If Fullscreen = True Then ToggleFullscreen

frmMain.Width = PixelsToTwips(Width, 0)

frmMain.Height = PixelsToTwips(Height, 1)

frmMain.Left = 0 '(Screen.Width / 2) - (frmMain.ScaleWidth / 2)

frmMain.Top = 0 '(Screen.Height / 2) - (frmMain.ScaleHeight / 2)

Options.ResoX = Width

Options.ResoY = Height

SaveOptions

End Sub

Public Sub ToggleFullscreen()

frmMain.WindowState = vbNormal

If Fullscreen = True Then

Fullscreen = False

Options.Fullscreen = 0

frmMain.BorderStyle = 1

frmMain.Caption = frmMain.Caption

SetResolution Options.ResoX, Options.ResoY

AddText "Fullscreen Mode disabled.", White

Else

Fullscreen = True

frmMain.BorderStyle = 0

frmMain.Caption = frmMain.Caption

frmMain.Width = Screen.Width

frmMain.Height = Screen.Width

frmMain.Left = 0

frmMain.Top = 0

frmMain.Caption = frmMain.Caption

Options.Fullscreen = 1

AddText "Fullscreen Mode enabled.", White

End If

SaveOptions

End Sub

```

(Apologies for the double post, but for some reason, editing a post removes all of the nesting.)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...