CSharp .Net Tutorial: Full-screen or Windowed Mode in Truevision 3D

James Cloud
Introduction

When designing computer games, it is only fitting to allow the user as much freedom as possible towards customising things like graphics, audio, game-play, and controls settings. Following the steps provided below, you will learn how to toggle your Truevision 3D game between full-screen and windowed mode, as well as control the resolution, color depth and more.

Step One - Full-screen Mode

To place the Truevision 3D engine into full-screen mode, call the 'Init3DFullscreen()' method found in the TVEngine object. 'Init3DFullscreen()' contains several overload that allow you to modify settings such as width, height, bpp, vertical sync, tl, etc. If you would like to simply turn on full-screen mode with a specific resolution, just call the 'Init3DFullscreen()' method and supply the width and the height of the desired resolution as the first and second parameters like so,

// Initialize in Fullscreen mode with resolution 1024 x 768
TV.Init3DFullscreen(1024, 768);

After adding the example code to your project, run the game and the screen will change its resolution to 1024 x 768 and the game will be in full-screen mode.

Step Two - Windowed Mode

Allowing the user to enter into full-screen in common in ninety percent of video games. However, only some games will give the user the ability to run the game in windowed mode. Truevision 3D, as with the full-screen function, comes with a nice and clean method that, when called, will change your application into windowed mode. This function is called, 'Init3DWindowed()'. 'Init3DWindowed()' comes with two simple overloads. The first overload simply set the windowed mode to the given handle. The second does the same as the first, but also allows the toggling of tl with the second parameter. Here is an example of initialize the engine in plain windowed mode,

// Initialize Truevision 3D in windowed mode
TV.Init3DWindowed(this.Handle);

This example code will put the Truevision 3D engine in windowed mode, rendering to the given handle, in this case, the main form's handle.

Published by James Cloud

I like to program and do basically anything that has to do with technology and computers.  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.