English
C ++ Forum

some Speicherfehler for the Image?

 
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  
 




Sebastian
König
Hello Peter,

in principle ought to it with Profan2Cpp just as functions How with XProfan - I go means time of it from, that it one Error in Profan2Cpp is. i'll me the time standing and me again report - can but unfortunately something last (wednesday evening or thursday tommorrow) I in the momentum straight quite ausgelastet be...

MfG

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



Hello Sebastian, thanks for your Help.

mfg
peter
 
09/08/08  
 



in the attachment is another with the equal Error.
with the Profan2cpp appear not The Bitmap.

steer can with the Keys "QWES"

mfg
peter

602 kB
Hochgeladen:09/08/08
Downloadcounter78
Download
 
09/08/08  
 




Sebastian
König
Hello Peter,

I have me The thing straight time respected. The good Message is, that the first Testcode with the coming Profan2Cpp 2.0 already correctly functions. only with the second (from the ZIP-archive) there yet a Darstellungsfehler (the car in the rechten Window is simply a black Box...). i'll me bemühen, this Bug in Version 2.0a To to fix.

Profan2Cpp 2.0 becomes official together with XProfan 11 attend (hopefully soon). into next Meet I will Schonmal the new Trial on the Profan2Cpp-Homepage to that Download take on.

MfG

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




into next Meet I will Schonmal the new Trial on the Profan2Cpp-Homepage to that Download take on.


Hmm..., are The next days already rum....
can hardly expect.

mfg
peter
 
09/11/08  
 




Sebastian
König
Peter Bierbachh
Hmm..., are The next days already rum....
can hardly expect.


i'll me bemühen, it to date evening (dt. Time) fertigzumachen.
 
Windows XP, XProfan/Profan² 4.5 bis 11
Profan2Cpp-Homepage:  [...] 
Alte Profan²-Seite:  [...] 
09/12/08  
 




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  
 




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.209 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