FANDOM


just a simple hello world app using the atg console and input

source codeEdit

So I can just edit this willy nilly then.

#include "stdafx.h"

#include <xtl.h>
#include <d3d9.h>
#include <xam.h>

#include <xui.h>
#include <xuiapp.h>
#include <iostream>
#include <fstream>
#include <string>

#include "AtgConsole.h"//simple text output to screen
#include "AtgFont.h"
#include "AtgInput.h"//get input from controler
using std::ofstream;//needed for the debug log
//--------------------------------------------------------
//GLOBALS

ATG::Console g_console;


void debugLog(char* output)
{
   ofstream writeLog;

   writeLog.open("game:\\debug.log",ofstream::app);
   if (writeLog.is_open())
   {
     writeLog.write(output,strlen(output));
     writeLog.write("\n",1);
   }
   writeLog.close();



}


void init(VOID)
{
    HRESULT hr = g_console.Create( "game:\\Media\\Fonts\\Arial_12.xpr", 0xff000000, 0xffffffff ); //create console
    if (FAILED (hr))
    {
      debugLog("creating console");// debuglog function
    }
    g_console.Format( "*** INITIALIZING ***\n" );//simple text output to screen
    

}

VOID __cdecl main()
{
    bool done =FALSE;
    init();
    g_console.Format( "PRESS A TO EXIT\n" );
    while(!done)
    {
      ATG::GAMEPAD* pGamepad = ATG::Input::GetMergedInput();// get input from controlers
       if( pGamepad->wPressedButtons  & XINPUT_GAMEPAD_A)
     {
        done = true;
     }
    }
    
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.