English
C ++ Forum

Why must I : drawogl 2x one after another prompt..

 
Why must I mean function : drawogl 2x one after another prompt, so itself the Objekt turn.
but only at Compilieren with Profan2Cpp. otherwise not.
The dll need one with to that term.
CompileMarkSeparation
 $H Windows.ph
DEF rgb_umwandlung(2) ! bmptex.dll,bmptex
declare x1!,y1!,dx!,dy!,winkel!,groesse&,handleogl&
declare hWin&,hwin1&,hintergr&,tex.auto&
declare width&,height&,texid&,ende&
declare bild_auto_h&,bild_umw_h&
declare bmi#,bildxy#
groesse&=128*128*4
dim bildxy#,groesse&
ende&=1
Window 20,20-800,600
Cls @RGB(220,220,220)
hWin& = Create(text, %hWnd, Test1, 10, 10, 128,128)
hWin1& = Create(text, %hWnd, Test2, 250, 20, 500,500)
oGL(Init, hwin&, 0,0, 0, 0)
oGL(PosMode, 1)
bild_auto_h& = Create(hnewPic,64,64,0 )
hintergr&=create(hnewpic,500,500,$00ffff)
tex.auto&=erzeugetex(auto.bmp)
drawogl
drawogl
oglzubmp
drawscene

WHILE ende&

    WaitInput

    if isKey(87)

        y1!=Sin((-winkel!)/180.0*pi())*2
        x1!=Cos((-winkel!)/180.0*pi())*2
        dx!=dx!-x1!
        dy!=dy!-y1!
        drawogl
        drawogl
        oglzubmp
        drawscene

    endif

    if isKey(83)

        y1!=Sin((-winkel!)/180.0*pi())*2
        x1!=Cos((-winkel!)/180.0*pi())*2
        dx!=dx!+x1!
        dy!=dy!+y1!
        drawogl
        drawogl
        oglzubmp
        drawscene

    endif

    if isKey(81)

        winkel!=winkel!+1.0
        drawogl
        drawogl
        oglzubmp
        drawscene

    endif

    if isKey(69)

        winkel!=winkel!-1.0
        drawogl
        drawogl
        oglzubmp
        drawscene

    endif

ENDWHILE

end

proc drawogl

    OGL(Clear)
    OGL(origin,0,0,-1.11)
    OGL(texture,tex.auto&,1)
    OGL(rotate,0,0,winkel!)
    OGL(quad,0.5,0.5)
    OGL(show)

endproc

proc oglzubmp

    DeleteObject handleogl&
    handleogl&=create(hPic,0,&OGLBMP )

endproc

proc drawscene

    StartPaint hwin1&
    drawpic hintergr&,0,0;0
    drawpic handleogl&,100+dx!,100+dy!,-1 ;-1
    EndPaint

endproc

proc bitmap_header

    def &BI_RGB 0
    def &DIB_RGB_COLORS 0
    struct BITMAPINFOHEADER =
    biSize&, biWidth&, biHeight&, biPlanes%, biBitCount%, biCompression&,
    biSizeImage&, biXPelsPerMeter&, biYPelsPerMeter&, biClrUsed&, biClrImportant&
    dim bmi#,BITMAPINFOHEADER
    clear bmi#

    with bmi#

        .biSize&        = sizeof(bmi#)
        .biWidth&       = width&
        .biHeight&      = height&
        .biPlanes%      = 1
        .biBitCount%    = 32
        .biCompression& = &BI_RGB
        .biSizeImage&   = ((.biWidth& * .biBitCount%  8 - 1) | 3 + 1) * abs(.biHeight&)

    endwith

endproc

proc erzeugetex

    parameters namebild$
    texid&=0
    height&=128
    width&=128
    dispose bmi#
    bitmap_header()
    bild_umw_h& = Create(hPic, -1, namebild$)
    ~GetDIBits(%hdc,bild_umw_h&,0,bmi#.biHeight&,bildxy#,bmi#,0)
    rgb_umwandlung(bildxy#,groesse&)
    OGL(glGenTextures,1,ADDR(texid&))
    OGL(glBindTexture,~GL_TEXTURE_2D,texid&)
    OGL(glEnable,~GL_ALPHA_TEST)
    OGL(glAlphaFunc,~GL_GREATER, 0.1)
    OGL(glTexParameteri,~GL_TEXTURE_2D, ~GL_TEXTURE_MAG_FILTER, ~GL_LINEAR)
    OGL(glTexParameteri,~GL_TEXTURE_2D, ~GL_TEXTURE_MIN_FILTER, ~GL_LINEAR)
    OGL(gluBuild2DMipmaps,~GL_TEXTURE_2D, ~GL_RGBA, height&, width&, ~GL_RGBA, ~GL_UNSIGNED_BYTE, bildxy#)
    dispose bildxy#
    ref='./../../Function-References/XProfan/return/'>RETURN texid&

endproc


2 kB
Hochgeladen:02/27/09
Downloadcounter205
Download
 
02/27/09  
 




Sebastian
König
Hello Peter,

Peter Bierbachh
Why must I mean function : drawogl 2x one after another prompt, so itself the Objekt turn.
but only at Compilieren with Profan2Cpp. otherwise not.
The dll need one with to that term.


unfortunately can I the trouble not yet understand... even if I The double drawogl-Aufrufe auskommentiere, can I none Difference between XProfan- and Profan2Cpp-Variante check. the Objekt turn and moving itself as should.

can it evtl. time anyone else, the here mitliest, with itself try?

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
02/27/09  
 



here times without dll.
in the left Ogl-Window turn it itself.
but in the rechten Window normalen Screen remaining it stand , is To see.
I have on Color Depth 32 and 16 bit probiert.
CompileMarkSeparation
 $H Windows.ph
declare x1!,y1!,dx!,dy!,winkel!,groesse&,handleogl&
declare hWin&,hwin1&,hintergr&,hintergr1&,tex.auto&,adresse%,groesse%
declare width&,height&,texid&,ende&
declare bild_auto_h&,bild_umw_h&
declare bmi#,bildxy#
groesse%=128*128*4
dim bildxy#,groesse%
ende&=1
Window 20,20-800,600
Cls @RGB(220,220,220)
hWin& = Create(text, %hWnd, Test1, 10, 10, 128,128)
hWin1& = Create(text, %hWnd, Test2, 250, 20, 500,500)
oGL(Init, hwin&, 0,0, 0, 0)
oGL(PosMode, 1)
bild_auto_h& = Create(hnewPic,64,64,0 )
hintergr&=create(hnewpic,500,500,$00ffff)
hintergr1&=create(hnewpic,500,500,$000000)
tex.auto&=erzeugetex(auto.bmp)
drawogl
drawogl
oglzubmp
drawscene

WHILE ende&

    if isKey(87)

        y1!=Sin((-winkel!)/180.0*pi())*2
        x1!=Cos((-winkel!)/180.0*pi())*2
        dx!=dx!-x1!
        dy!=dy!-y1!
        drawogl
        drawogl
        oglzubmp
        drawscene

    endif

    if isKey(83)

        y1!=Sin((-winkel!)/180.0*pi())*2
        x1!=Cos((-winkel!)/180.0*pi())*2
        dx!=dx!+x1!
        dy!=dy!+y1!
        drawogl
        drawogl
        oglzubmp
        drawscene

    endif

    if isKey(81)

        winkel!=winkel!+1.0
        drawogl
        drawogl
        oglzubmp
        drawscene

    endif

    if isKey(69)

        winkel!=winkel!-1.0
        drawogl
        drawogl
        oglzubmp
        drawscene

    endif

ENDWHILE

end

proc drawogl

    OGL(Clear)
    OGL(origin,0,0,-1.11)
    OGL(texture,tex.auto&,1)
    OGL(rotate,0,0,winkel!)
    OGL(quad,0.5,0.5)
    OGL(show)

endproc

proc oglzubmp

    DeleteObject handleogl&
    handleogl&=create(hPic,0,&OGLBMP )

endproc

proc drawscene

    StartPaint hintergr1&
    drawpic hintergr&,0,0;0
    drawpic handleogl&,100+dx!,100+dy!,-1 ;-1
    EndPaint
    StartPaint hwin1&
    drawpic hintergr1&,0,0;0
    EndPaint

endproc

proc bitmap_header

    def &BI_RGB 0
    def &DIB_RGB_COLORS 0
    struct BITMAPINFOHEADER =
    biSize&, biWidth&, biHeight&, biPlanes%, biBitCount%, biCompression&,
    biSizeImage&, biXPelsPerMeter&, biYPelsPerMeter&, biClrUsed&, biClrImportant&
    dim bmi#,BITMAPINFOHEADER
    clear bmi#

    with bmi#

        .biSize&        = sizeof(bmi#)
        .biWidth&       = width&
        .biHeight&      = height&
        .biPlanes%      = 1
        .biBitCount%    = 32
        .biCompression& = &BI_RGB
        .biSizeImage&   = ((.biWidth& * .biBitCount%  8 - 1) | 3 + 1) * abs(.biHeight&)

    endwith

endproc

proc erzeugetex

    parameters namebild$
    texid&=0
    height&=128
    width&=128
    dispose bmi#
    bitmap_header()
    bild_umw_h& = Create(hPic, -1, namebild$)
    ~GetDIBits(%hdc,bild_umw_h&,0,bmi#.biHeight&,bildxy#,bmi#,0)
    bmptex()
    OGL(glGenTextures,1,ADDR(texid&))
    OGL(glBindTexture,~GL_TEXTURE_2D,texid&)
    OGL(glEnable,~GL_ALPHA_TEST)
    OGL(glAlphaFunc,~GL_GREATER, 0.1)
    OGL(glTexParameteri,~GL_TEXTURE_2D, ~GL_TEXTURE_MAG_FILTER, ~GL_LINEAR)
    OGL(glTexParameteri,~GL_TEXTURE_2D, ~GL_TEXTURE_MIN_FILTER, ~GL_LINEAR)
    OGL(gluBuild2DMipmaps,~GL_TEXTURE_2D, ~GL_RGBA, height&, width&, ~GL_RGBA, ~GL_UNSIGNED_BYTE, bildxy#)
    dispose bildxy#
    RETURN texid&

endproc

proc bmptex

    adresse%=bildxy#
    P2CPP: <INLINE_CPP>
    long zaehler;
    long wert;
    unsigned char b;
    unsigned char g;
    unsigned char r;
    long adrr;
    wert=PVAR(groesse%);
    adrr=PVAR(adresse%);
    char* bereich = reinterpret_cast<char*>(adrr);
    for(zaehler = 0; zaehler <= wert; zaehler = zaehler + 4)

    {

        b=bereich[zaehler] & 255;
        g=bereich[zaehler+1] & 255;
        r=bereich[zaehler+2] & 255;

        if ((r==0) & (b==0) & (g==0))

            bereich[zaehler+3]=0;

        else

            {

                bereich[zaehler+3]=255;

            }

            bereich[zaehler+2]=b;
            bereich[zaehler]=r;

        }

        P2CPP:
span class=s2>/INLINE_CPP> endproc

49 kB
Hochgeladen:02/27/09
Downloadcounter243
Download
 
02/27/09  
 




Sebastian
König
Peter Bierbachh
here times without dll.
in the left Ogl-Window turn it itself.
but in the rechten Window normalen Screen remaining it stand , is To see.
I have on Color Depth 32 and 16 bit probiert.


means by me at least is the Result same - it turn itself in both Windows, even if I The double Aufrufe auskommentiere.
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
02/27/09  
 




Sebastian
König
Nachtrag: On another system could I the Error now reproduzieren. I login me here again, once I The cause found have.
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
02/27/09  
 



Imho (only überflogen) DeleteObject handleogl& at first Male handleogl& without worth.

rather
CompileMarkSeparation
case handleogl& : DeleteObject handleogl&
>
 
02/27/09  
 




Sebastian
König
around the Thread here abzuschließen: The latest stood is, that it by me on one XP-system in both mutants (XProfan and Profan2Cpp) functions, on one others (with Vista) however fundamentally not. it shining So one Completed: &OGLBMP To give, that not Profan2Cpp-specific is... Peter has here [...]  a alternative described, the ever sure functions ought to.
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
03/01/09  
 




Sebastian
König
Hello Peter,

at testing of/ one new, on Your glReadPixels()-example aufbauenden Variant for &OGLBMP pushed I a little while ago on a mysteriösen crash, the unregelmäßig auftrat. I mean The cause in Your C++-code found to have: in the row
CompileMarkSeparation ought to of my opinion to the <= ein einfaches < sein, sonst wird die Bereichsgrenze um einige Bytes überschritten. Da ich vermute, dass der Bug auch in der DLL steckt, wollte ich hier mal darauf hinweisen...

MfG

Sebastian
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
03/04/09  
 




funkheld
Thank you.

but the Window in the Hauptrogramm becomes first drawn if I it with the mouse something moved have.

Thank you.
greeting
 
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

7.877 Views

Untitledvor 0 min.
H.Brill10/29/23
funkheld05/14/23
Georg Teles02/03/18
Andreas Koch11/08/16
More...

Themeninformationen



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