English
Online-Documentation

ogl.tutorial.initialisierung Statement: OpenGL

 
← back to OGL-Tutorialübersicht ogl->tutorial 

[head]introduction[/head]
Hello Friends the XProfan-OpenGL,

these one attempt the Implementierung of Tutorials into OnlineDoku.

The OnlineDoku is therefore particularly suitable there Members discretionary mitmischen, correct and strain can.

in this chapter widme I solely the making one OpenGL-Fensters the later to display Objects serve should.

here goes not therefore ogl ("init"... with its Parameters To explain.

initially ought to one itself for a Variante decide:

? Erzeugung <a href='#full'>Vollbild-Gamescreen</a> How with redcube 
? Erzeugung <a href='#win'>Fenster-Gamescreens</a>
? Erzeugung <a href='#gdi'>Fenster with OGL-Anzeigebereich next to GDI-Controls</a> How z.B. with okrea 

nevertheless simply time beforehand one Minisource which OpenGL simply created and a Cuboiden shows:
cls
ogl("init",%hwnd,0.0,0.0,0.0,1)
ogl("clear")
ogl("origin",0,0,-10)
ogl("cuboid",1,1,1)
ogl("show")
waitinput
end

[head]>full Vollbild-Gamescreen produce[/head]
One Vollbild-Gamescreen produce is the leichteste all Übungen, birgt but nevertheless The Tücke because of the Anzeigeproportionalität.

Who integrally simply would like created means first one Mainwindow %hwnd  and initialized simply hereon the OGL. the functions so:
windowstyle 80'Window without each Schnickschnack
window 0,0 - %maxx,%maxy'filled screen fill out
ogl("init",%hwnd,0,0,0,1)
waitinput
ogl("done")
end

According as which dissolution on the computer tuned is becomes hiernach one gröstmögliches Window created and OpenGL hereon initialized.

now can But his the The dissolution not typical 4/3 is - the heist - the The Y-dissolution z.B. not How with 640x480 or 1024x768 very the Dreiviertel the X-dissolution is. too The new TFT-displays come gladly with very unterschiedlichen Auflösungen therefore - How z.B. 1280x768 or 1280x1024.

the XProfanOpenGL-Anzeigefenster skaliert itself however not unproportional what to follow has the z.B. left and right one schwarzer edge come into being can. If (%maxx /4*3)<%maxy  is arise supra and under one edge, otherwise arise the edge left and right.

The möglicherweise entstehende edge is insofern problematically there the edge nevertheless to that draw of OpenGL is used. the place z.B. of a Cockpit went means not there either the Cockpit not entire To see is or "unterhalb" of Cockpit one edge arise with the z.B. The Street/country To see would. The edge must means lane!

valet we means one Tricks we're The Bildschirmauflösung not Change want. we weg now time of it from the The Y-dissolution greater his can as %maxx /4*3. inverse ists seltener the case - can but just as vorkommen!

we produce simply one second Window below of %hwnd  what whom whole screen ausfüllt, and insert in the Size angepasstes (4/3Proportional!) %hwnd  simply above.
windowstyle 80'Window without each Schnickschnack
var bgwin&=createwindow(0,"",0,0,%maxx,%maxy)'on Desktop one Hintergrundfenster produce
enablewindow bgwin&,0'deaktivieren we it so one Click the window yet less tangiert
window 0,0 - maxx,maxy/4*3
setwindowpos hwnd%=0,((maxy-(maxx/4*3))/2) - maxx,maxx/4*3;-1'hwnd in Bildschirmmitte verrücken and whom Vordergrund fetch.
ogl("init",%hwnd,0,0,0,1)
waitinput
ogl("done")
end

naturally can now the bgwin& z.B. a colour miss out on. For this, can simply startpaint  benefit:
startpaint bgwin&
cls 0'make wirs simply Black
endpaint

More moreover later...

[head]>win Window-Gamescreen produce[/head]
as well as at Vollbild-Gamescreen must we on The Proportionalität of OGL-Anzeigebereich respect. The inside area of %hwnd  ought to means 4/3 his.

Hierbei can we following small procedure zunutze make:

on these procedure can we Höhe and wide transfer and the %hwnd  becomes on these Maße adjusted.

produce we means first of all one Window and fit The Size on Proportionalität on:
cls'Window produce
setinnersize width(%hwnd),(width(%hwnd)/4*3)

Hierdrauf now whom OpenGL-Anzeigebereich initialisieren:
ogl("init",%hwnd,0,0,0,1)
waitinput
ogl("done")
end

and the wars already. naturally ought to one by windowstyle  for care the either a) one Vergrössern/Verkleinern/Skalieren the %hwnd  you don't say so is or b) to recognition of/ one Skalierung of %hwnd  anew setinnersize How supra Call.

More moreover later...

[head]>gdi OGL-Anzeigebereich next to GDI-Controls produce[/head]
these sure a the worst releases because The position and Size the OGL-Anzeigebereiches can we not to determine. The OGL-Anzeigebereich filling always whom kompletten Parent from and takes its Ausmaße on.

Hierbei must we means whom OGL-Anzeigebereich on one other Control instead of the %hwnd  lay.

After plenty Herumprobiererei with okrea  can I of something experience report the to on the best one Control used becomes what with this function prepares becomes:
proc createChildWindowAsStatic

    parameters h&,s$,x&,y&,xx&,yy&
    declare ws&
    h&=create("ChildWindow",h&,s$,x&,y&,xx&,yy&)'child produce
    'titelbar and welt Remove | setwindowlonggedöns
    ws&=GetWindowLongA(h&,-16) - $C00000 - $40000
    SetWindowLongA(h&,-16,ws&)
    return h&

endproc


we produce means first the Mainwindow %hwnd :
cls'Window produce
setinnersize width(%hwnd),(width(%hwnd)/4*3)

produce then our OGL-Child:
var ogl.child&=createChildWindowAsStatic(%hwnd,".OglParent",0,0,width(%hwnd),height(%hwnd))

and initialisieren now hierdrauf our OGL-Anzeigebereich:
ogl("init",ogl.child&,0,0,0,1)
waitinput
ogl("done")
end

ready. now can we simply with setwindowpos  the control ogl.child& positionieren and so too our OGL-Anzeigebereich. After Positionierung of ogl.child& ought to too always one ogl("Show") erfolgen there here no automatisches Repaint of Statten goes.

More moreover later...
 
02/08/07  
 



Note / Question or Comment to the Help--Topic


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

750 Views

Untitledvor 0 min.
Tango08/06/21
Donnie04/07/13

Themeninformationen

this Topic has 1 subscriber:

iF (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