i have plugged in the fractal procedure with your code which are posted before the update, and it works without errors when going from window 0 to window 1
Code: Select all
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>> >>
;>> Name: dos ventanas >>
;>> >>
;>> Author: (c) Tom Z?hringer >>
;>> Chimorin >>
;>> Bananenfreak >>
;>> >>
;>> Date: 06.03.2015 >>
;>> >>
;>> OS: Windows >>
;>> >>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;EnableExplicit
Declare Biomorph()
Define.f KeyX, KeyY, MouseX, MouseY
Define nx.f, nz.f, Boost.f = 1
Define.i Quit, event
#kam_0 = 0
#plane = 0
#planent = 0
#constreal = 0.5
#constimag = 0
#screenheight = 500
#screenwidth = 500
#listPoints = 1
Enumeration windows
#win0
#win1
EndEnumeration
Enumeration gadgets
#but0
#but1
#but2
EndEnumeration
Procedure Window0()
OpenWindow(#win0, 0, 0, 200, 200, "Options", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)
ButtonGadget(#but0, 10, 10, 100, 40, "To Win1")
EndProcedure
Procedure Window1()
Protected.i boden
OpenWindow(#win1, 200, 20, 400, 400, "3D-section", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)
OpenWindowedScreen(WindowID(#win1), 110, 10, 400, 400, 0, 10, 10, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget)
ButtonGadget(#but1, 10, 10, 100, 40, "To Win0")
ButtonGadget(#but2, 10, 60, 100, 40, "rot/stop")
;WorldShadows(#PB_Shadow_TextureAdditive, 200, RGB(255 * 0.2, 255 * 0.2, 255 * 0.2), 4096)
AmbientColor(RGB(255 * 0.2, 255 * 0.2, 255 * 0.2))
CreatePlane(#plane, 100, 100, 100, 100, 100, 100)
boden = GetScriptMaterial(#PB_Any, "Scene/GroundBlend")
CreateEntity(#planent, MeshID(#plane), MaterialID(boden), 0, 0, 0)
;CreateCube(#cube, 2)
;CreateEntity(#cube, MeshID(#cube), #PB_Material_None , -1, 2, -3)
;-Camera
CreateCamera(#kam_0, 0, 0, 100, 100)
MoveCamera(#kam_0, 0, 3, 10, #PB_Absolute)
CameraLookAt(#kam_0, 0, 1, 0)
;CameraRange (#kam_0, 2, 5000)
;CameraFOV (#kam_0, 90)
CameraBackColor(#kam_0, RGB(0, 0, 0))
SkyDome("clouds.jpg", 100) ;for blue color background
CreateMaterial(0, LoadTexture(0, "White.jpg"))
DisableMaterialLighting(0, #True)
CreateMesh(1, #PB_Mesh_PointList, #PB_Mesh_Dynamic)
Biomorph() ; calling the biomorph generator function
TransformMesh(1, 0, 2, 0, 1/5, 1/5, 1/5, 0, 0, 0 )
CreateEntity(1, MeshID(1), MaterialID(0), -1, 0, -2)
EndProcedure
If InitEngine3D()
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Textures", #PB_3DArchive_FileSystem)
Add3DArchive(#PB_Compiler_Home + "Examples/3D/Data/Scripts", #PB_3DArchive_FileSystem)
Parse3DScripts()
InitSprite()
InitKeyboard()
Window0()
rotate = 1
Repeat
Repeat
event = WindowEvent()
Select event
Case #PB_Event_Gadget
Select EventGadget()
Case #but0
Window1()
Case #but1
;CloseScreen()
CloseWindow(#win1)
Window0()
Case #but2
If rotate
rotate ! 1
Else
rotate ! 1
EndIf
EndSelect
Case #PB_Event_CloseWindow
Select EventWindow()
Case #win0
Quit = 1
Case #win1
Quit = 1
EndSelect
EndSelect
Until event = 0
If IsWindow(#win1)
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Up)
MoveCamera(0, 0, 0, -1 * Boost)
ElseIf KeyboardPushed(#PB_Key_Down)
MoveCamera(0, 0, 0, 1 * Boost)
EndIf
If KeyboardPushed(#PB_Key_Left)
MoveCamera(0, -1 * Boost, 0, 0)
ElseIf KeyboardPushed(#PB_Key_Right)
MoveCamera(0, 1 * Boost, 0, 0)
EndIf
If KeyboardPushed(#PB_Key_Escape)
quit = 1
EndIf
EndIf
RotateEntity(1,0,rotate,0, #PB_Relative)
RenderWorld()
FlipBuffers()
EndIf
Until Quit = 1
Else
MessageRequester("Error", "The 3D Engine can't be initialized", 0)
EndIf
End
Procedure Biomorph()
aspectratio.f = #screenwidth / #screenheight
ymax.f = 10
ymin.f = -ymax
xmax.f = ymax * aspectratio
xmin.f = -xmax
ilimit.l = #screenheight - 1
jlimit.l = #screenwidth - 1
x.f: y.f: x0.f: y0.f: xx.f: yy.f
xmax.f = ymax * aspectratio
For i = 0 To ilimit
For j = 0 To jlimit
x0 = xmin + (xmax - xmin) * j / jlimit
y0 = -ymin - (ymax - ymin) * i / ilimit
x = x0
y = y0
For n = 1 To 100
xx = x * (x * x - 3 * y * y) + #constreal: ; THIS Line And the Next give the cube
yy = y * (3 * x * x - y * y) + #constimag: ; of the Number, plus a constant
x = xx
y = yy
If Abs(x) > 10 Or Abs(y) > 10 Or x * x + y + y > Pow(10,2)
n = 100
EndIf
Next n
If Abs(x) < 10 Or Abs(y) < 10
;Plot(j,i, RGB(0,0,0))
MeshVertexPosition(x0, y0, 0)
MeshVertexColor(RGB(0,0,0))
Else
;Plot(j,i, RGB(255, 255, 255 ))
;MeshVertexPosition(x0, y0, 0)
;MeshVertexColor(RGB(255,255,0))
EndIf
Next j
Next i
FinishMesh(#True)
EndProcedure