| |
|
|
- Page 1 - |
|
| 4 plains Parallax Scrolling with vSync
Download: [...]
the demonstration have I on wish prepares.
The application benötig of OpenGL The permit on the VSync the Bildschirmes Waiting To can.
is these option not Anwendungsgesteuert set then becomes a Error Message outputted.
The code is messy and only fix gepinselt - it went only therefore To show the on able Systemen loosly 60fps possible are.
Exe in the attachment. CompileMarkSeparation {$cleq}
const apptitle=oglscrl
#include oglhelper.inc
ogl.window(apptitle,1,800,600,,,,,60)
long tex.bg1=ogl.loadTex(bild1.tex,,,false),
tex.bg2=ogl.loadTex(bild2.tex,,,false),
tex.bg3=ogl.loadTex(bild3.tex,,,false),
float t,y
casenot ogl.vsync(true)==true : err(Cant init V-Sync.)
do {
ogl.main()
t=t+2
y=y+(mousey-y)*0.1
case mousePressed : break
}
ogl.done()
ogl.main(){
ogl.clear
ogl.2dnow()
ogl(color,1,1,1,1)
ogl.scrollPlane(tex.bg2,-t mod 6400*0.25,600)
ogl(color,1,1,1,0.7)
ogl.scrollPlane(tex.bg2,(-t mod 3200)*0.5,1200)
ogl(color,1,1,1,1)
ogl.2dmove(0,y*-0.1)
ogl.scrollPlane(tex.bg1,(-t mod 1600),700)
ogl.2dmove(0,370-y*0.5)
ogl.scrollPlane(tex.bg3,(-t mod 800)*2,600)
ogl.show
}
ogl.scrollPlane(long tex,float p,y){
ogl(texture,tex,1)
ogl.rectangle(p+0,0,p+800,y)
ogl.rectangle(p+1600,0,p+2400,y)
ogl.rectangle(p+1600,0,p+800,y)
}
err(string s){
messagebox(s,apptitle,4096)
end
}
|
|
|
| |
|
|
| |
|
- Page 2 - |
|
|
| Schade, there's means in the ogl vlt. another bow cache. |
|
|
| |
|
|
|
Frank Abbing | Hm, but is it with this method possible, each Hintergrundsbilder To manipulating? One circa with this Bespiel To stay: the itself z.B. the head the cat turn can? |
|
|
| |
|
|
|
| to that a is a Echtzeitmanipulation of Textures self-evident dank OpenGL possible, to that second is z.B. turn circa 3 Achsen at all no trouble - too a Abfolge of Textures (animated) is simply To release as well as the barge of Textures ineinander. |
|
|
| |
|
|
|
Frank Abbing |
The code is messy and only fix gepinselt - it went only therefore To show the on able Systemen loosly 60fps possible are.
The code is without The Inc not run and shows therefore too nothing. |
|
|
| |
|
|
|
| Yes, unfortunately, but lauffähige Codes are well not my thing.
thatswhy stayed I rather with the lauffähigen Exe - rockt More. (and goes too without inc?)
The abgebildete code is it which in the Exe agiert, therefore have I the code posted - which itself you simply not show wants.
think you whom code simply lane. |
|
|
| |
|
|
|
Frank Abbing | The engineering with the transformed TGA-Images is eh not really efficient. once the Blendung yet on another place needed becomes, fail these method. its too no pure XProfan-Solution, How angekündigt, separate almost only API. Sogesehen are too XPIA-Codes pure XProfan-Solutions, because LONG even one XProfan-commands is. VSync-availability only abzufragen is ditto not optimal. rather is it, it zuzuschalten. if not yet happen. |
|
|
| |
|
|
|
|
The engineering with the transformed TGA-Images is eh not really efficient. once the Blendung yet on another place needed becomes, fail these method.
your assumption is wrong, I use no TGA. the stature is 4 byte per Pixel without Header. from the Filesize yields the dissolution.
The Blendung is additionally too individually gestaltbar.
its too no pure XProfan-Solution, How angekündigt, separate almost only API. Sogesehen are too XPIA-Codes pure XProfan-Solutions, because LONG even one XProfan-commands is.
its a pure XProfan-Solution.
VSync-availability only abzufragen is ditto not optimal. rather is it, it zuzuschalten. if not yet happen.
too wrong, the code setting VSync and gives whom success back. |
|
|
| |
|
|
|
Frank Abbing |
your assumption with the TGA-Files is wrong, I use no TGA. the stature is 4 byte per Pixel without Header.
Yes, You uses one own - unkomprimiertes stature: RGBA. an Solution for people, The The TGA-method not utilize would. These engineering becomes with NeHe declared (Lesson 32 faith I). |
|
|
| |
|
|
|
| One code for the Reading TGA as OGL-Texture have I here already posted. ;)
I use the stature purposely z.B. to that testing. |
|
|
| |
|
|
|
Frank Abbing | is too no code engineering. I yourself likes TGA neither. and PNG with mask is unfortunately not so simply To manage. |
|
|
| |
|
|
|
| The oglhelper.inc has pieces The yet in the building are, therefore have I tappt im dunkeln not angehangen.
The here required functions herausfitzeln held I do not for meaningfully.
If the oglhelper in all sharing useable is it can eachone use. |
|
|
| |
|
|
|
Frank Abbing | |
|
| |
|
|