English
C ++ Forum

some Speicherfehler for the Image?

 
- Page 1 -


If I here in the program my linkes Opengl-Image turn (Button Q/E), should in the rechten Window the image as normales Pic displayed go.
it functions so far under the normalen Profan, with Profan2cpp not
The problem, is if I anfange To turn, then becomes the rights Image renewed, but the Area is knows, there are no data drin

must in Profan2cpp somehow the memory for Image etc differently reserved go?
which Error have I made.
under is the entire Program.

in the attachment is a zipper too with a EXE of Profan and a EXE of Profan2cpp
CompileMarkSeparation
 $H Windows.ph
DEF rgb_umwandlung(2) ! "bmptex.dll","bmptex"
declare x1!,y1!,dx!,dy!,winkel!,y&,z%,a&,test%
declare bild_auto_h&,bild_umw_h&
declare bmi#,bildxy# ,ogl_rgb#
dim ogl_rgb#,128*128*4+1032
var texid%=0
var ende%=1
Window 20,20-600,400
Cls @RGB(220,220,220)
var hWin& = @Create("text", %hWnd, "Test1", 10, 10, 128,128)
var hWin1& = @Create("text", %hWnd, "Test1", 180, 10, 250,250)
oGL("Init", hwin&, 0,0, 0, 0)
oGL("PosMode", 1)
ogl("glReadBuffer",~GL_Front)
bild_auto_h& = Create("hPic", -1,"leer.bmp") Bildcontainer für "setDIBits"
var tex.auto%=erzeugetex("auto.bmp")
setTimer 18
drawglscene
drawglscene
oglzubmp

WHILE ende%

    WaitInput

    if isKey(81)

        winkel!=winkel!+1.0
        drawglscene
        oglzubmp()

    endif

    if isKey(69)

        winkel!=winkel!-1.0
        drawglscene
        oglzubmp()

    endif

ENDWHILE

killTimer
end

proc oglzubmp

    ogl("glReadPixels",0,0,128,128,~GL_BGRA,~GL_UNSIGNED_BYTE,ogl_rgb#)
    ~setDIBits(%hdc,bild_auto_h&,0,128,ogl_rgb#,bmi#,0)
    mcls 128,128
    startpaint -1
    drawpic bild_auto_h&,0,0,-1
    endpaint
    startpaint hWin1&
    mcopybmp 0,0-127,127>50,50,-1
    endpaint

endproc

proc drawglscene

    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 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&       = 128
        .biHeight&      = 128
        .biPlanes%      = 1
        .biBitCount%    = 32
        .biCompression& = &BI_RGB
        .biSizeImage&   = ((.biWidth& * .biBitCount%  8 - 1) | 3 + 1) * abs(.biHeight&)

    endwith

endproc

proc erzeugetex

    parameters namebild$
    bitmap_header()
    bild_umw_h& = Create("hPic", -1, namebild$)
    a&=bmi#.biSizeImage&
    dim bildxy#,a&+1032
    ~GetDIBits(%hdc,bild_umw_h&,0,bmi#.biHeight&,bildxy#,bmi#,0)
    rgb_umwandlung(bildxy#,a&)
    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, 128, 128, ~GL_RGBA, ~GL_UNSIGNED_BYTE, bildxy#)
    dispose bildxy#
    RETURN texid%

endproc


mfg
peter

590 kB
Hochgeladen:09/08/08
Downloadcounter95
Download
 
09/08/08  
 



 
- Page 1 -



Sebastian
König
OK, Done on the Profan2Cpp-Homepage  [...]  there now The Trial 2.0 to that Download.
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/12/08  
 



Hello, the went but Superschnell.
The graphic functions too How tappt im dunkeln should.

an crazy work the whole Profan2cpp 2.0

If I now with BCC55 compiliere, can I then there too "if-auswertungen " ala C++ according BCC55 reinbringen etc or there there any particular einschränkungen, the only bestimmter code taken go must?

One Error?
The Compiler beanstandet The "PVAR", the it The not knows, if I I on moreover go, crashes it ex.
CompileMarkSeparation
declare x%,y%
x%=1
y%=100
cls
test(x%,y%)
WaitInput
end

proc test

    parameters c%,d%
    <INLINE_CPP>
    DWORD a = PVAR(c%);
    DWORD b = PVAR(d%);
    </INLINE_CPP>

09/12/08  
 




Jörg
Sellmeyer
whether with the the Inline CPP goes, can I not say but you mean still sure "EndProc" and not "end proc", or?
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
09/12/08  
 



oGL("scale", scale_1!, scale_1!,scale_1!)

this commands becomes beanstandet, because the incorrect amount of Parameters transfer becomes.
with Scale go but 3 Parameter transfer.
(was with verse 1.6c not)

mfg
peter
 
09/12/08  
 



One Parameter for ogl.Scale! (into entrapment be so did i already getappt)
 
09/12/08  
 



 
- Page 2 -


"end proc"

naturally together. watts here wrong reinkopiert.
is in my beanstandeten Program correctly..

mfg
 
09/12/08  
 



procedure glScaled(x, y, z: TGLdouble);

statement from Opengl-Delphi .

mfg
peter
 
09/12/08  
 



incorrect Helpfile, ogl("scale",x!) is XProfan - not Delphi. here becomes additionally The API used, that can You with XProfan integrally simply: ogl("glScaled",...
 
09/12/08  
 



means then ought to the time in XProfan10 /11 the daily original commands adjusted go.

mfg
peter
 
09/12/08  
 



there's no Abweichungen, there are 2 different functions and Languages. whom sense behind it, ogl.scale on 1 Parameter To limit, have I but then already not found. Roland could too 3 Parameter make possible.
 
09/12/08  
 




Sebastian
König
Hello Peter,

The instruction for the Inline-C++ ought to one comment his:
CompileMarkSeparation
...
P2CPP: <INLINE_CPP>
DWORD a = PVAR(c%);
DWORD b = PVAR(d%);
P2CPP: </INLINE_CPP
/pre>

From Profan2Cpp from there for code really no direct Einschränkung - You can simply time try, what functions and what not.

MfG

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



Ah...what about me thought the this "<INLINE_CPP>" one commands was.

thanks.

mfg
peter
 
09/13/08  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.249 Views

Untitledvor 0 min.
funkheld12/17/13

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