Flacker Problem

Übersicht BlitzMax, BlitzMax NG Allgemein

Neue Antwort erstellen

Schnittlauch

Unkraut

Betreff: Flacker Problem

BeitragSa, Jan 06, 2007 20:45
Antworten mit Zitat
Benutzer-Profile anzeigen
Hallo
Folgende codezeile sorgt dafür das von Geschwindigkeit nichts zu spüren ist und
das bild teilweiße übelst flackert. Es wird in unregelmäßigen abständen ausgefürt
und das vor allen anderen Draw befehlen.

Das ganze soll flecken auf den Bildschirm malen.
Und ich dachte das wäre die Speicherschonenste lösung weil
es viele flecken werden.

Code: [AUSKLAPPEN]


While cls usw
...

crossrot = crossrot + (0.1*fspeed)
if crossrot > 360 Then crossrot = 0
         
For Local tempdrop:tdrop = EachIn droplist
   if tempdrop.y > tempdrop.max_y Then
      addfleck(tempdrop.x,tempdrop.y)
      droplist.Remove(tempdrop)
      drops = drops - 1
   End If            
Next
         
SetAlpha(eralpha)
DrawImage errorbg,400,300
SetAlpha(1)
DrawImage monitor,400,300
DrawImage(dreckimg,400,300)
DrawText(cscore,0,0)
DrawText(score,0,50)

...
flip

Function addfleck(x:Short,y:Short)
'   Cls   
   SetColor 0,0,0
   DrawRect(0,0,800,600)
   SetColor 255,255,255
   DrawImage(dreckimg,0,0)
   DrawImage(fleck,x,y)
   GrabImage(dreckimg,0,0)
   Cls
End Function


Edit Ich glaube mehr Code ist nicht nötig.
Ich wars nicht.
  • Zuletzt bearbeitet von Schnittlauch am So, Jan 07, 2007 14:23, insgesamt einmal bearbeitet

simi

BeitragSa, Jan 06, 2007 20:55
Antworten mit Zitat
Benutzer-Profile anzeigen
Wie wärs mit dem ganzen Programmcode??

Mit diesem kleinen Codefetzen kann man höchstens vermutungen anstellen Wink

shure_kyu

Newsposter

BeitragSa, Jan 06, 2007 21:07
Antworten mit Zitat
Benutzer-Profile anzeigen
mach mal Code: [AUSKLAPPEN]
flip 1

_______//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\________
◄Blitz 3D/MAX • PC - 2x 3.16Ghz, 4GB-Ram, ATi HD 4890 1024MB• win7 • site$ Rush2Play ° My-Htc.de
¯¯¯¯¯¯¯\__________________________________________________________________________//¯¯¯¯¯¯¯¯
BBP-RSS FEED Halt dich auf dem laufenden!
(C)Shure_kyu
 

D²O

BeitragSa, Jan 06, 2007 22:38
Antworten mit Zitat
Benutzer-Profile anzeigen
shure_kyu hat Folgendes geschrieben:
mach mal Code: [AUSKLAPPEN]
flip 1


BMax kennt doch kein Flip 1/0 das wird im Graphics befehl eingestellt

Graphics Breite,höher,farbtiefe,Hz,flags

Hz = Standartmässig auf 60Hz eingestellt
0 = die im Treiber eingestellt Bildschirmfrequenz
-1 = ohne Vsync


@ Schnittlauch,
das CLS, kommt das öfters in Deinem Code vor??
Blitz+; Blitz3d; BlitzMax; GLBasic; Purebasic;
GameMaker Studio 1.4xx; AGK;
 

klepto2

BeitragSa, Jan 06, 2007 23:12
Antworten mit Zitat
Benutzer-Profile anzeigen
@D²O:
Das mit dem Flip ist so nicht richtig:

Aus der Doc:

Flip swap the front and back buffers of the current graphics objects.
If sync is 0, then the flip occurs as soon as possible. If @sync is 1, then the flip occurs
on the next vertical blank.
If sync is -1 and the current graphics object was created with the Graphics command,
then flips will occur at the graphics object's refresh rate regardless of whether or not the
graphics hardware supports such a refresh rate.
If sync is -1 and the current graphics object was NOT created with the Graphics command,
then the flip will occur on the next vertical blank.
Matrix Screensaver
Console Modul für BlitzMax
KLPacker Modul für BlitzMax

HomePage : http://www.brsoftware.de.vu

Blitzcoder

Newsposter

BeitragSa, Jan 06, 2007 23:26
Antworten mit Zitat
Benutzer-Profile anzeigen
Klar kann Max Flip 0/1.
P4 3 Ghz@3,55Ghz|GF 6600GT 256MB|Samsung 80GB | 2x Samsung 160GB|2048MB DDR-400 RAM|6 Mbit Flatrate | Logitech G15 | Samsung 225BW-TFT | Ubuntu Gutsy Linux | Windows Vista | Desktop | Blog | CollIDE | Worklog
________________
|°°°°°°°°°°°°°°||'""|""\__,_
|______________ ||__ |__|__ |)
|(@) |(@)"""**|(@)(@)****|(@)

Schnittlauch

Unkraut

BeitragSo, Jan 07, 2007 14:19
Antworten mit Zitat
Benutzer-Profile anzeigen
Ohne diese Zeile geht es, und ganzer Code wird schwierig, ist zu viel.
Ich versuch ma das wichtigste reinzustellen.

EDIT Ok, flackern tut es nicht mehr, aber das ganze Programm fängt an zu stottern. Code ist der selbe geblieben.
Ich wars nicht.
 

Dreamora

BeitragSo, Jan 07, 2007 14:42
Antworten mit Zitat
Benutzer-Profile anzeigen
Natürlich wird es stottern.
GrabImage ist kein Echtzeitbefehl, er ist viel zu langsam. Und du machst das ganze dann auch noch in Massen so wie es aussieht ...
Nutze da lieber GrabPixmap und bleib auf Pixmaps, wenn es irgend einen Grund gibt, dass du umbedingt soviel grabben müsstest.

(ach ja, ich gehe einfach mal davon aus, dass du im Vollbild modus bist, Fenstermodus ist nach wie vor nicht 100% sauber funktionsfähig und hat speziell im DX Modus mitunter gewisse Probleme)
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen.

Schnittlauch

Unkraut

BeitragSo, Jan 07, 2007 15:21
Antworten mit Zitat
Benutzer-Profile anzeigen
OK, thx.
Ich wars nicht.

Neue Antwort erstellen


Übersicht BlitzMax, BlitzMax NG Allgemein

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group