[bb] Infinite far clipplane by bytecode77 [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:40

Previous topic - Next topic

BlitzBot

Title : Infinite far clipplane
Author : bytecode77
Posted : 1+ years ago

Description : This code creates an infinitive far clipplane.
You need to download the direct x 7 dll which is included to my shadow system on www.devil-engines.net .
you also need to initialize and free the dx7 dll like in the sample below.

Note: If you are already using my shadow system, you don't have to call this code. the shadow system will do it. also you MUST use freedx7() at the end.


Code :
Code (blitzbasic) Select
Type DX7_Matrix
Field m1#, m2#, m3#, m4#
Field m5#, m6#, m7#, m8#
Field m9#, m10#, m11#, m12#
Field m13#, m14#, m15#, m16#
End Type

Function InitDX7()
If DX7_SetSystemProperties(SystemProperty("Direct3D7"), SystemProperty("Direct3DDevice7"), SystemProperty("DirectDraw7"), SystemProperty("AppHWND"), SystemProperty("AppHINSTANCE")) Then RuntimeError "Error initializing dx7."
If DX7_GetStencilBitDepth() < 8 Then
DX7_CreateStencilBuffer()
If DX7_GetStencilBitDepth() < 8 Then RuntimeError "Graphic card does not support stencil buffers."
End If
End Function

Function FreeDX7()
DX7_RemoveSystemProperties()
End Function

Function DX7_InfiniteFarClipPlane()
m.DX7_Matrix = New DX7_Matrix
DX7_GetTransform 3, m
mm11# = 1
mm15# = -.1
DX7_SetTransform 3, m
Delete m
End Function


Comments : none...