For whatever reason, poster.jpg doesn't load into my plane.
I found that it did load if commented out this line:
InitError = AGKVR.Init( RightEyeImg, LeftEyeImg )
So somehow, the VR plugin is blocking the texture. Never experienced this before!
// Project: vr-poster
// Created: 2018-07-26
// show all errors
SetErrorMode(2)
//Load the AGKVR plugin
#import_plugin AGKVR
// set window properties
SetWindowTitle( "vr-poster" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 0 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetSyncRate( 90, 0 ) // 30fps instead of 60 to save battery
//SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
SetAntialiasMode( 1 ) // 0=off, 1=4xMSAA
SetDefaultMagFilter( 1 ) // 0=nearest, 1=linear
SetDefaultMinFilter( 1 ) // 0=nearest, 1=linear
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetClearColor (128,128,128)
//Set the Camera Range in AGKVR
//It is necessary to use this command for setting the camera's range instead of the standard AGK SetCameraRange command
AGKVR.SetCameraRange( 0.001, 300.0 )
//Initialiaze AGKVR
//------------------------------------------------
// The parameters are the Right and Left Eye image ID's that will be used to render to the HMD
InitError As Integer
RightEyeImg As Integer = 500
LeftEyeImg As Integer = 501
InitError = AGKVR.Init( RightEyeImg, LeftEyeImg )
// InitError = 0: SUCCESS!
// InitError = 1: Unable to init VR runtime
// InitError = 2: Compositor initialization failed.
//This command will lock the player's heading direction
//to follow the turn angle of the HMD. This would be common in FPS games, where
//you want the forward moving direction's turn angle to change based on where the
//player is looking. LockPlayerTurn is ON(1) by default
AGKVR.LockPlayerTurn( 1 )
//This command will lock the player's heading direction (forward on the Z axis)
//to follow the pitch angle of the HMD. This would be useful in a freeflight style game
//where you want the forward moving direction's pitch angle to change based on where the
//player is looking. LockPlayerPitch is OFF(0) by default
AGKVR.LockPlayerPitch( 0 )
AGKVR.SetWorldScale( 1.00 )
SetGenerateMipmaps( 0 )
posterImg as integer
posterImg = loadImage("poster.jpg")
poster as integer
poster = CreateObjectPlane (0.594 , 0.841) // A1 paper size
setObjectPosition (poster, 0.0, 1.6, 1.0)
SetObjectLightMode( poster, 0 )
setObjectImage (poster, posterImg, 0)
do
AGKVR.UpdatePlayer( )
AGKVR.Render( )
Sync()
loop