| |
|
|
- 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 |
 |
|
| |
|
|
|
| |
|
- 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 |
|
|
|
|
 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 |
|
|
| |
|
|
|
 | One Parameter for ogl.Scale! (into entrapment be so did i already getappt) |
|
|
| |
|
|
| |
|
- Page 2 - |
|
|
 | "end proc"
naturally together. watts here wrong reinkopiert. is in my beanstandeten Program correctly..
mfg |
|
|
| |
|
|
|
 | procedure glScaled(x, y, z: TGLdouble);
statement from Opengl-Delphi .
mfg peter |
|
|
| |
|
|
|
 | incorrect Helpfile, ogl("scale",x!) is XProfan - not Delphi. here becomes additionally The API used, that can You with XProfan integrally simply: ogl("glScaled",... |
|
|
| |
|
|
|
 | means then ought to the time in XProfan10 /11 the daily original commands adjusted go.
mfg peter |
|
|
| |
|
|
|
 | 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. |
|
|
| |
|
|
|
 Sebastian König | Hello Peter,
The instruction for the Inline-C++ ought to one comment his: CompileMarkSeparation 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 |
|
|
| |
|
|