cypher and PB ?
Posted: Tue Jul 13, 2004 4:18 pm
Did anyone try cypher ?
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
obj_Engine\Init3DFullscreen(#Temp_Width, #Temp_Height, #Temp_Depth, #Temp_EnableTnL, #Temp_EnableVSync, #TV_DEPTHBUFFER_16BITS, #Temp_Gamma, WindowID) _Code: Select all
-----------------------------------------------------------
Engine started at 07-12-2004 15:10:59
-----------------------------------------------------------
07-12-2004 15:10:59 | ########################
07-12-2004 15:10:59 | # TVUTIL62 initialized #
07-12-2004 15:10:59 | ########################
07-12-2004 15:10:59 | TVUTIL62 : Version 6 Revision 100
07-12-2004 15:10:59 | TVUTIL62 File Path C:\WINDOWS\System32\tvutil62.dll
07-12-2004 15:10:59 | DEVICE INIT : Problem in the IntForm.Show part
07-12-2004 15:10:59 | VENDOR INFO : Video card :NVIDIA GeForce FX 5200 / 4318
07-12-2004 15:10:59 | INITIALIZE : Starting Engine version 0.6.0 rc3 * LIMITED VERSION *
07-12-2004 15:10:59 | DEVICE INIT : Create the device with 800x600 ane the DX8 format 22 / Depth Buffer : 32
07-12-2004 15:10:59 | DEVICE INIT : Pure device 3d card detected. Unsupported by the engine at this time.
07-12-2004 15:10:59 | DEVICE INIT : Your device supports Single pass Multitexturing. Pixel Shaders & Lightmapping will use it
07-12-2004 15:10:59 | DEVICE INIT : MIXED HARDWARE/SOFTWARE USED
07-12-2004 15:11:00 | VIEWPORT MANAGER : Main viewport initialization
07-12-2004 15:11:00 | VIEWPORT MANAGER : Main viewport initialized (800x600)
07-12-2004 15:11:00 | DEVICE INIT : Average Free Texture memory : 366 MB
07-12-2004 15:11:00 | DEVICE INIT : Device initialized without problem.
07-12-2004 15:11:00 | CAMERA FACTORY : Initialized
07-12-2004 15:11:00 | DEVICE INIT : Create Matrices
07-12-2004 15:11:00 | DEVICE INIT : Viewport size (800 600)
07-12-2004 15:11:00 | DEVICE INIT : Set the viewport...
07-12-2004 15:11:00 | DEVICE INIT : Initialize Vertex shaders
07-12-2004 15:11:00 | MD2 SYSTEM : Preparing md2 vertex shader
07-12-2004 15:11:00 | MD2 SYSTEM : MD2 Vertex Shader created.
07-12-2004 15:11:00 | MDL SYSTEM : Vertex Shader created.
07-12-2004 15:11:00 | TEXTURE REQUIREMENTS CHECKING : D3DFMT_R5G6B5 : Yes
07-12-2004 15:11:00 | TEXTURE REQUIREMENTS CHECKING : D3DFMT_A1R5G6B5 : Yes
07-12-2004 15:11:00 | DEVICE INIT : DOT3 Bumpmapping supported
07-12-2004 15:11:00 | DEVICE INIT : Initialization finished ...
07-12-2004 15:11:00 | INPUT MANAGER : Global initializationCode: Select all
; Attempt to interface TrueVision 3d Engine with PureBasic
; All code (C)2004 Lee S. Ackerley
; 28th June 2004
; ========================================================
; Include the interface files
XIncludeFile "TV3D_Interfaces.pbi"
XIncludeFile "TV3DMedia_Interfaces.pbi"
XIncludeFile "tv3dcpp.pbi"
; Declare temporary constants
#Temp_Width = 800
#Temp_Height = 600
#Temp_Depth = 32
#Temp_EnableTnL = #TRUE
#Temp_EnableVSync = 0
#Temp_Gamma = 1
#Temp_Hwnd = #NULL
#TRUE = 1
#FALSE = 0
Enumeration
#Window_0
EndEnumeration
; Temp Windows message structure
Structure tv_MSG
hwnd.l
message.l
wParam.l
lParam.l
time.l
; pt.POINT
EndStructure
; Declare Procedures
Declare TV3D_Initialize()
Declare TV3D_Release()
; Declare the required pointers to the interface objects
Global obj_Engine._TVEngine
Global obj_Input._TVInputEngine
; Global *gp_Globals._TVGlobals ; Not required at the moment
; Global *gp_Scene._TVScene ; Not required at the moment
Global OutputID = ScreenOutput()
Global *p_Message
Global g_message.tv_MSG
; If OpenWindow(#Window_0, 216, 0, 640, 480, #PB_Window_Invisible | #PB_Window_ScreenCentered, "")
;
; Initialize the engine
; WindowID = WindowID(#Window_0)
TV3D_Initialize()
; /// TEMPORARY - Initialize keyboard input
If InitKeyboard()
; /// MAIN LOOP BEGIN
Repeat
While g_message\message <> #WM_QUIT
*p_Message = g_message\message
If PeekMessage_(*p_Message, NULL, 0, 0, #PM_REMOVE)
TranslateMessage_(*p_Message)
DispatchMessage_(*p_Message)
EndIf
Gosub sub_Render
Gosub sub_Input
; /// TEMPORARY - emergency PB input for escape
If KeyboardPushed(#PB_Key_Escape)
ReleaseObject(obj_Input)
obj_Input = NULL
ReleaseObject(obj_Engine)
obj_Engine = NULL
*p_Message = NULL
End
EndIf
Wend
ForEver
Else
MessageRequester ("Error", "Cannot initialize keyboard input", #PB_MessageRequester_Ok)
EndIf
; Else
;
; MessageRequester("Error", "Cannot open window", #PB_MessageRequester_Ok)
;
; ReleaseObject(obj_Input)
; obj_Input = NULL
;
; ReleaseObject(obj_Engine)
; obj_Engine = NULL
;
; *p_Message = NULL
;
; End
; EndIf
; /// MAIN LOOP END
; ===========
;- SUBROUTINES
; ===========
; /// Render subroutine
sub_Render:
; Render : Draw everything between the 'Clear' and 'RenderToScreen' functions
obj_Engine\Clear(#FALSE)
obj_Engine\RenderToScreen()
Return
; /// Input subroutine
sub_Input:
; Monitor input : If the escape key is pressed, release then engine and end the program
If obj_Input\IsKeyPressed(#TV_KEY_ESCAPE)
TV3D_Release()
PostQuitMessage_(0)
End
EndIf
Return
; ==========
;- PROCEDURES
; ==========
; /// Initialize the TV3D Engine
Procedure TV3D_Initialize()
; Initialize COM /// Must be done FIRST before engine is initialized \\\ (* May not be right *)
;CoInitialize_(#NULL)
; Create TV Engine object / open fullscreen mode / Display FPS / Place watermark at bottom right at
; opacity of 70%
obj_Engine = CreateObject("TrueVision3D.TVEngine")
obj_Engine\Init3DFullscreen(#Temp_Width, #Temp_Height, #Temp_Depth, #Temp_EnableTnL, #Temp_EnableVSync, #TV_DEPTHBUFFER_BESTBUFFER, #Temp_Gamma, OutputID)
obj_Engine\put_DisplayFPS(#TRUE)
obj_Engine\SetWatermarkParameters(#TV_WATERMARK_TOPRIGHT, 0.7)
; Create Input Engine object
obj_Input = CreateObject("TrueVision3D.TVInputEngine")
EndProcedure
; /// Release the TV3D Engine safely
Procedure TV3D_Release()
; *REMEMBER* COM objects should be released in reverse creation order
; Release Input Engine object
ReleaseObject(obj_Input)
;obj_Input\Release()
obj_Input = NULL
; Release TV Engine object
ReleaseObject(obj_Engine)
;obj_Engine\Release()
obj_Engine = NULL
;UnInitialize COM /// Must be done LAST to safely release engine \\\ (* May not be right *)
;CoUninitialize_()
EndProcedureCode: Select all
Global OutputID = ScreenOutput() Code: Select all
Global OutputID = WindowID()