I've experienced some issues with D3D ever since I started using it, but I waited to post until I was sure it was the root of my problems. Here are the problems I've been having with D3D. I am not experiencing any of these issues when D3D is disabled.
-Text on the main menu disappears after about 45 seconds of the program running. At times it will randomly reappear, though much smaller and the incorrect color.
-When entering a "contract" (randomly generated scenario), there is a very noticeable FPS drop of about 10-15 fps for the first minute or so of being in the contract. After that it slowly climbs back up.
-The game visuals stop updating at random times, despite the game still running (sounds still work perfectly).
Below is a bit of the code I'm using to display the text. I looked through some examples and from what I can tell my implementation is correct, but I may have the commands in the wrong order or something of the sort.
D3D_FONT 1, "Orbitron Medium", 30, 0, 0, 1
`Play
SELECT arr_MainMenu(1).State
CASE 0:
D3D_COLOR 0, 0, 0, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(1).OffsetX, arr_MainMenu(1).OffsetY, 0, "Play"
D3D_ENDTEXT
ENDCASE
CASE 2:
D3D_COLOR 255, 255, 255, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(1).OffsetX, arr_MainMenu(1).OffsetY, 0, "Play"
D3D_ENDTEXT
ENDCASE
ENDSELECT
`Characters
SELECT arr_MainMenu(2).State
CASE 0:
D3D_COLOR 0, 0, 0, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(2).OffsetX, arr_MainMenu(2).OffsetY, 0, "Characters"
D3D_ENDTEXT
ENDCASE
CASE 1:
D3D_COLOR 0, 210, 255, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(2).OffsetX, arr_MainMenu(2).OffsetY, 0, "Characters"
D3D_ENDTEXT
ENDCASE
CASE 2:
D3D_COLOR 255, 255, 255, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(2).OffsetX, arr_MainMenu(2).OffsetY, 0, "Characters"
D3D_ENDTEXT
ENDCASE
ENDSELECT
`Options
SELECT arr_MainMenu(3).State
CASE 0:
D3D_COLOR 0, 0, 0, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(3).OffsetX, arr_MainMenu(3).OffsetY, 0, "Options"
D3D_ENDTEXT
ENDCASE
CASE 1:
D3D_COLOR 0, 210, 255, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(3).OffsetX, arr_MainMenu(3).OffsetY, 0, "Options"
D3D_ENDTEXT
ENDCASE
CASE 2:
D3D_COLOR 255, 255, 255, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(3).OffsetX, arr_MainMenu(3).OffsetY, 0, "Options"
D3D_ENDTEXT
ENDCASE
ENDSELECT
`Exit
SELECT arr_MainMenu(4).State
CASE 0:
D3D_COLOR 0, 0, 0, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(4).OffsetX, arr_MainMenu(4).OffsetY, 0, "Exit"
D3D_ENDTEXT
ENDCASE
CASE 2:
D3D_COLOR 255, 255, 255, 255
D3D_STARTTEXT
D3D_TEXT 1, arr_MainMenu(4).OffsetX, arr_MainMenu(4).OffsetY, 0, "Exit"
D3D_ENDTEXT
ENDCASE
ENDSELECT
Has anyone experienced similar problems using D3D? Did you find a solution? If not, are there alternatives that would allow me to use custom fonts?
EDIT: Just thought I'd post the setup code where I call the command "D3D_INIT".
BACKDROP OFF
SET DISPLAY MODE 1024, 768, 16, 1
SYNC ON: SYNC RATE 0
`Camera.
AUTOCAM OFF
ROTATE CAMERA 90, 0, 0
`Images.
SET IMAGE COLORKEY 255, 0, 255
`Objects
SET GLOBAL OBJECT CREATION 4
`Font
D3D_INIT
var_File$ = DIR EXE() + "Orbitron Medium.ttf"
var_Value = ADD FONT(var_File$)
var_File$ = DIR EXE() + "Orbitron Bold.ttf"
var_Value = ADD FONT(var_File$)
`Disables the escape key from exiting the game.
DISABLE ESCAPEKEY