Die 3D Gadgets und 3D Windows funktionieren eigentlich genauso wie dir normalen. Ich habe gerade festgestellt, auch wenn man das Subsystem rausnimmt rennt OGRE (genauer gesagt CEGUI) gegen die Wand. Den Fehler hatte ich bisher aber noch nie. Aber anscheinend hat es etwas mit den Berechtigungen zu tun, weil meine eigenen Quelltexte die nicht in einem Unterverzeichnis von Programme liegen kann ich starten ohne dass OGRE/CEGUI rumzickt.
Habe auch Windows 7 Ultimate (64-Bit). Einfach mal via Copy and Paste ein Quelltext von mir (ist natürlich ohne die dazugehörigen Mediendateien nicht lauffähig):
Code: Alles auswählen
;------------------------------------------------------------------------------
; Declarations
;------------------------------------------------------------------------------
EnableExplicit
Enumeration ; Window3Ds
#Window3D_TermsOfUse
EndEnumeration
Enumeration ; Gadget3Ds
#Gadget3D_Editor_TermsOfUse
#Gadget3D_Option_AcceptTermsOfUse
#Gadget3D_Option_DeclineTermsOfUse
#Gadget3D_Button_Proceed
EndEnumeration
Global ApplicationName.s = "CEGUI Theme Development"
Global ScreenWidth, ScreenHeight, Windowed, RenderingWindow, WindowEvent
Global Theme.s
Procedure FatalError(Message.s)
MessageRequester(ApplicationName, Message)
End
EndProcedure
;------------------------------------------------------------------------------
; Reading Preferences
;------------------------------------------------------------------------------
If OpenPreferences("Test.ini") = #False
FatalError("Failed to read Test.ini!")
EndIf
PreferenceGroup("Graphics")
ScreenWidth = ReadPreferenceInteger("ScreenWidth", 0)
ScreenHeight = ReadPreferenceInteger("ScreenHeight", 0)
Windowed = ReadPreferenceInteger("Windowed", #True)
PreferenceGroup("CEGUI")
Theme = ReadPreferenceString("Theme", "")
ClosePreferences()
;------------------------------------------------------------------------------
; Open Screen
;------------------------------------------------------------------------------
If InitEngine3D() = #False
FatalError("Failed to initialize 3D Engine!")
EndIf
If InitSprite() = #False
FatalError("Failed to initialize DirectX!")
EndIf
If InitKeyboard() = #False
FatalError("Failed to initialize Keyboard!")
EndIf
If InitMouse() = #False
FatalError("Failed to initialize Mouse!")
EndIf
If Windowed = #True
RenderingWindow = OpenWindow(#PB_Any, 0, 0, ScreenWidth, ScreenHeight, ApplicationName, #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
OpenWindowedScreen(WindowID(RenderingWindow), 0, 0, ScreenWidth, ScreenHeight, 0, 0, 0)
Else
OpenScreen(ScreenWidth, ScreenHeight, 32, ApplicationName)
EndIf
If CreateCamera(0, 0, 0, 100, 100) = #False
FatalError("Failed to create camera!")
EndIf
Add3DArchive("Base/", #PB_3DArchive_FileSystem)
Add3DArchive(Theme + "/", #PB_3DArchive_FileSystem)
SetGUITheme3D("Scifi", "Commonwealth-10")
;------------------------------------------------------------------------------
; Create Windows
;------------------------------------------------------------------------------
Global Window3DPadding = 50
OpenWindow3D(#Window3D_TermsOfUse, 0, 0, 600, 400, "Terms of use")
EditorGadget3D(#Gadget3D_Editor_TermsOfUse, Window3DPadding, Window3DPadding, WindowWidth3D(#Window3D_TermsOfUse) - (Window3DPadding * 2), WindowHeight3D(#Window3D_TermsOfUse) - (Window3DPadding * 3))
ButtonGadget3D(#Gadget3D_Button_Proceed, WindowWidth3D(#Window3D_TermsOfUse) - Window3DPadding - 100, WindowHeight3D(#Window3D_TermsOfUse) - (Window3DPadding * 1.25), 100, Window3DPadding / 2, "Proceed")
; OpenWindow3D(0, 50, 50, 600, 600, "Test", #PB_Window3D_SizeGadget)
; ButtonGadget3D(0, 50, 50, 150, 30, "Click me!")
; GadgetToolTip3D(0, "Total useless Button! :D" + Chr(10) + "With supercool linebreak!")
; CheckBoxGadget3D(1, 50, 100, 150, 30, "Check this out")
; ComboBoxGadget3D(2, 50, 200, 150, 50)
; AddGadgetItem3D(2, -1, "Huray!")
; AddGadgetItem3D(2, -1, "What the hell?")
; AddGadgetItem3D(2, -1, "I know.")
; Frame3DGadget3D(4, 50, 300, 400, 195, "Frame")
; StringGadget3D(5, 300, 150, 100, 25, "Whatever")
; TextGadget3D(6, 300, 50, 200, 50, "This is a TextGadget3D.")
; OptionGadget3D(7, 75, 425, 300, 25, "Yes, I agree with the terms of use")
; OptionGadget3D(8, 75, 450, 300, 25, "No, I don't agree with the terms of use")
ShowGUI(255, #True)
MouseLocate(ScreenWidth / 2, ScreenHeight / 2)
If SkyBox("Skybox.png") = #False
FatalError("Failed to create Skybox!")
EndIf
;------------------------------------------------------------------------------
; Procedures
;------------------------------------------------------------------------------
Global InputEvent3DText.s
Procedure HandleGUIKeyboardInput()
Protected KeyboardInkey.s = KeyboardInkey()
Protected ActiveGadget3D, GadgetType3D
Protected CurrentText.s, NewText.s
InputEvent3DText = KeyboardInkey
; Backspace handling
If KeyboardReleased(#PB_Key_Back)
ActiveGadget3D = GetActiveGadget3D()
If ActiveGadget3D <> #PB_Any
GadgetType3D = GadgetType3D(ActiveGadget3D)
If GadgetType3D = #PB_GadgetType3D_Editor Or GadgetType3D = #PB_GadgetType3D_String
CurrentText = GetGadgetText3D(ActiveGadget3D)
NewText = Left(CurrentText, Len(CurrentText) - 2)
SetGadgetText3D(ActiveGadget3D, NewText)
EndIf
EndIf
EndIf
; Return handling
If KeyboardReleased(#PB_Key_Return)
ActiveGadget3D = GetActiveGadget3D()
If ActiveGadget3D <> #PB_Any
GadgetType3D = GadgetType3D(ActiveGadget3D)
If GadgetType3D = #PB_GadgetType3D_Editor
Debug "New line"
AddGadgetItem3D(ActiveGadget3D, 0, "Weißte?!")
;SetGadgetText3D(ActiveGadget3D, GetGadgetText3D(ActiveGadget3D) + Chr(10))
EndIf
EndIf
EndIf
EndProcedure
;------------------------------------------------------------------------------
; Main Loop
;------------------------------------------------------------------------------
Repeat
If Windowed
Repeat
WindowEvent = WindowEvent()
If WindowEvent = #PB_Event_CloseWindow
End
EndIf
Until WindowEvent = #False
EndIf
ExamineKeyboard()
ExamineMouse()
ClearScreen(#Black)
If KeyboardPushed(#PB_Key_Escape)
End
EndIf
HandleGUIKeyboardInput()
InputEvent3D(MouseX(), MouseY(), MouseButton(#PB_MouseButton_Left), InputEvent3DText)
RenderWorld()
FlipBuffers()
ForEver