Hi Leute,
es ist durchaus möglich einen DX9 Code mit Purebasic so zu schreiben das er ohne Probleme unter WIN XP und Windows 7 läuft. Dafür habe ich mir ja dir Arbeit von MP3D gemacht.
Den code habe ich "übersetzt", kleine Änderung die Schrift wird stufig tranzpartent dargestellt
Hier mal mit VsyncOn (circa 2% CPU Leistung)
http://em.q-soft.ch/files/get/fDGLAhe3kN/test.exe
und Hier mit VsyncOff (Circa 50% bei 2000 FPS)
http://em.q-soft.ch/files/get/EWIBX3NoK ... yncoff.exe
läuft bei mir unter Windwos XP und Windows 7
Gruß Michael
Code: Alles auswählen
;////////////////////////////////////////////////////////////////
;//
;// Project Title: MP_TextVsync
;// Dateiname: MP_TextVsync.pb
;// Erstellt am: 20.1.2010
;// Update am :
;// Author: Michael Paulwitz
;//
;// Info:
;// Textdarstellung
;//
;//
;////////////////////////////////////////////////////////////////
;- ProgrammStart
MP_Graphics3D(800,600,0,0)
;mp_vsync(0) ; mp_vsync(0) = VsyncOff
CreateImage(0, 8, 8)
StartDrawing(ImageOutput(0))
Box(0,0,8,8,RGB(0,255,255))
StopDrawing()
Sprite = MP_SpriteFromTexture(MP_ImageToTexture(0))
Font = MP_LoadFont ("Impact",28,0,0); "Fontname",Groesse,bold,italic
MP_AmbientSetLight (RGB(50,100,200))
MP_UseCursor(0)
A.f = 255 ; Transparenz
While Not MP_KeyDown(#PB_Key_Escape)
MP_TextSetColor(MP_ARGB(A,0,0,0)) ; Setzt die Transparenz der Schrift
A - 1 * 60 * MP_VSyncTime() ; Bleibt Zeitsyncron, da ms genau auch be VsyncOff
If A < 0 : A = 255 : EndIf
MP_DrawText(100,50,"text text text text text")
MP_DrawText(100,100,"text text text text text")
MP_DrawText(100,150,"text text text text text")
MP_DrawText(100,200,"text text text text text")
MP_DrawText(100,250,"text text text text text")
MP_DrawText(100,300,"text text text text text")
MP_DrawText(100,350,"text text text text text")
MP_DrawText(100,400,"text text text text text")
MP_DrawText(100,450,"text text text text text")
MP_DrawText(100,500,"text text text text text")
MP_DrawText(400,250,"FPS = "+Str(MP_FPS()))
MP_DrawSprite(Sprite, WindowMouseX(0),WindowMouseY(0),255)
MP_RenderWorld()
MP_Flip ()
Wend