Jump to content
OGXbox.com

Meerjel01’s XTL Tutorials


Meerjel01
 Share

Recommended Posts

This topic is gonna be about programming for the Original Xbox using the official Xbox Developer Kit! Using DirectX 8. Since I’m capable of it I decided to make my own tutorial series for people to learn from. Let’s begin!

First you’ll need to download and install the tools. I’m not gonna instruct you on the process of getting the DevKit to work or where to get it. This is just a C++ tutorial. After you’ve opened VS2003, make a new project. There’s a preset for Xbox developers in the New Project window, use it, make it an empty game application and create a .cpp file. In the file, include the xtl library.

 

#inlcude <xtl.h>

The main method should also look like this.

Void __cdecl main() { }

There’s a site dedicated to DirectX/C++ development so use that first if you don’t know how the basics of the XTL works.

https://xbdev.net/tuts/tuts.php

 

After that, I’m gonna tell you how I do things.

  • Like 2
Link to comment
Share on other sites

When you’re about to program a game engine, make it as organized as you can. Make a lot of classes. This time I’m gonna tell you to make a game class that’ll contain the data for the actual gameplay. It’s recommended to do that. Make a game.h file and a class called CGame (Or how you like it to be called). It’s gonna contain the necessities for your game to run like update functions (EarlyUpdate(), Update(), LateUpdate()) and the render function(You probably only need one).

You can keep the actual game loop in the main.cpp file but you can decide if you want the game’s functions to be called in the while loop in main or inside the actual game.

 

Example on calling game funcs in main.cpp (You can find the DirectX draw methods in the website I linked)

While(true)

{

game.EarlyUpdate();



game.Update();

(DirectX Draw Start)



game.Render();



(DirectX Draw End)



game.LateUpdate();

}

 

Example on calling game funcs on the actual game.

While(true)

{

if(game->loop() == 0)

break;

}

The draw functions is in the CGame class so the main.cpp method is highly still valid here.

Also keep making functions and variables for everything needed because that’s what makes a game run good enough OR great. Don't repeat code, use static methods!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

Board Life Status


Board startup date: April 23, 2017 12:45:48
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.