English
Forum

OGL-Image and nNewPic appear first if I it short move., Why ?

 

funkheld
Hello, good day.
I take one drehendes Image the OGL-Window and place it in a hNewPic dar. I make it because it in OGL simply is such a thing To turn.
Fuktioniert too so far wonderful. mere at first started of Program appear the OGL-BIld first in the OGL-Window if I it at least short right
or left turned have. the hNewpic appear first , if I the Mainwindow with the Mauss something moving have.

where have I Please at Start one obstacle drin?

Thank you.
greeting
declare hWin&,hintergrpic&,vordergrpic&
declare ende&,winkel!,groesse&,dib&,array&
declare bild_auto&,car1&,car11&,pi180!
declare bmi#,ogl_rgb#
declare x1!,y1!,dx!,dy!
Declare ClassName$
Def &GL_BGR $80E0
DEF CreateDIB(2) !"dib","CreateDIB"
DEF FreeDIB(1) !"dib","FreeDIB"
DEF DrawDIB(4) !"dib","DrawDIB"
DEF CloneDIB(1) !"dib","CloneDIB"
dib&=usedll("dib.dll")
hintergrpic& = create("hNewPic", 400,400,rgb(255,255,0))
vordergrpic& = create("hNewPic", 400,400,rgb(255,255,0))
bild_auto& = create("hNewPic", 128,128,rgb(255,255,0))
Pi180!=0.0174532925199433
ende&=1
array&=CreateDIB(128,128)
groesse&=128*128*4
dim ogl_rgb#,groesse&
startpaint hintergrpic&
USEP 0,1,Rgb(0,255,0)
usebrush 1,rgb(0,255,0)
ellipsis 150,150-250,250
endpaint
Window 20,20-800,600
Cls RGB(220,220,220)
ClassName$ = "Fenster"
External("User32", "GetClassNameA", %HWnd, ClassName$, 64)
hWin& = Control(Trim $(ClassName$), "", $50000000, 10, 10, 128, 128, %HWnd, 0, %HInstance)
oGL("Init",hwin&,0,0,0,0)
oGL("PosMode", 1)
auto1&=oGL("LoadTextureBMP","d:/XProfan/pxpse/data/car1.bmp",1)
auto11&=oGL("LoadTextureBMP","d:/XProfan/xpse/data/car11.bmp",1)
OGL("Clear")
OGL("texture",car1&,1)
drawglscene
draw

WHILE ende&

    if isKey(89)

        OGL("texture",car1&,1)
        drawglscene
        draw

    ElseIf Iskey(65)

        OGL("texture",car11&,1)
        drawglscene
        draw

    EndIf

    if isKey(87)

        y1!=Sin(-winkel!*Pi180!)*0.3
        x1!=Cos(-winkel!*Pi180!)*0.3
        dx!=dx!-x1!
        dy!=dy!-y1!
        draw

    Elseif isKey(83)

        y1!=Sin(-winkel!*Pi180!)*0.3
        x1!=Cos(-winkel!*Pi180!)*0.3
        dx!=dx!+x1!
        dy!=dy!+y1!
        draw

    endif

    if isKey(81)

        winkel!=winkel!+0.5
        drawglscene
        draw

    Elseif isKey(69)

        winkel!=winkel!-0.5
        drawglscene
        draw

    EndIf

EndWhile

FreeDIB(array&)
end

Proc draw

    StartPaint vordergrpic&
    DrawPic hintergrpic&,0,0;0
    drawpic bild_auto&,50+dx!,50+dy!;-1
    EndPaint
    DrawPic vordergrpic&, 300,50;0

ENDPROC

proc drawglscene

    OGL("quad",0.5,0.5)
    OGL("origin",0,0,-1.2)
    OGL("rotate",0,0,winkel!)
    OGL("show")
    ogl("glReadPixels",0,0,128,128,&GL_BGR, ~GL_UNSIGNED_BYTE,ogl_rgb#)
    setDIBits(%hdc,bild_auto&,0,128,ogl_rgb#,array&,0)

endproc

 
04/28/16  
 




RGH
without The DIB.DLL can you none help, there itself the program not perform can.

Greeting
Roland
 
XProfan X3
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
04/28/16  
 




funkheld
Jup, here's tappt im dunkeln.
I thought , it would a problem in the Programmierstruktur.

greeting

3 kB
Hochgeladen:04/28/16
Downloadcounter126
Download
 
04/28/16  
 




Georg
Teles
be no oGL User, so on speedy but if I the following make to the While Loop:

2 time means of eachone Proc, then becomes it drawn, Perhaps is what in drawglscene take off draw procedure benütigt and is inverse ?

PS: the trouble trod here already once on  [...] 

Hello
 
XProfan X3
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

04/28/16  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.306 Views

Untitledvor 0 min.
H.Brill10/29/23
funkheld01/06/22
iF10/31/20
Normann Strübli04/13/20
More...

Themeninformationen

this Topic has 3 subscriber:

funkheld (2x)
Georg Teles (1x)
RGH (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie