Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Opengl na odredjenom delu forme

[es] :: Pascal / Delphi / Kylix :: Opengl na odredjenom delu forme

[ Pregleda: 1119 | Odgovora: 5 ]

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Trodmi

Član broj: 58036
Poruke: 166
*.dialup.neobee.net.



Profil

icon Opengl na odredjenom delu forme17.09.2006. u 08:27

Kako da opengl crta recimo na panelu ili nekom odredjenom delu forme a bez koriscenja 3rd party komponenti?
17.09.2006. u 08:27 

IvanBeograd
Beograd

Član broj: 83376
Poruke: 245
*.rcub.bg.ac.yu.

Sajt: www.dza-bu-drz-ne-daj.com


Profil

icon Re: Opengl na odredjenom delu forme20.09.2006. u 10:57
Mozes da postavis glViewport na panel.
npr da kazes glViewport(0,0,panel.width,panel.heigth).
Mada bi ti najlakse bilo da koristis GLScene,potpuno su besplatne,i ima jedna komponenta GLSceneViewer,
koju mozes da postavis na panel i preko nje iscratavas to sta ti treba.
Poz
SERVIA NOSTRUM REGNUM!
20.09.2006. u 10:57 

Trodmi

Član broj: 58036
Poruke: 166
*.dialup.neobee.net.



Profil

icon Re: Opengl na odredjenom delu forme22.10.2006. u 12:08
Ovo ne radi vec samo bude resize. Znaci kako da mi rendering context ne bude canvas forme vec recimo panel ili nesto drugo.
22.10.2006. u 12:08 

Almedin

Član broj: 5895
Poruke: 256
*.dlp288.bih.net.ba.



Profil

icon Re: Opengl na odredjenom delu forme22.10.2006. u 22:00
Evo kako ja radim:

Code:

procedure SetupGLWindow(AWindow: TWinControl);
var
 DC:HDC;
 RC:HGLRC;
begin
 DC:=GetDC(AWindow.Handle);
 SetupPixelFormat(DC);
 RC:=wglCreateContext(DC);
 wglMakeCurrent(DC, RC);
end;

procedure SetupPixelFormat(DC:HDC);
const
 pfd:TPIXELFORMATDESCRIPTOR = (
    nSize:sizeof(TPIXELFORMATDESCRIPTOR);    // size
    nVersion:1;                // version
    dwFlags:PFD_SUPPORT_OPENGL or PFD_DRAW_TO_WINDOW or PFD_DOUBLEBUFFER;
                                                    // support double-buffering
    iPixelType:PFD_TYPE_RGBA;        // color type
    cColorBits:24;                // prefered color depth
    cRedBits:0;
  cRedShift:0;        // color bits (ignored)
  cGreenBits:0;
  cGreenShift:0;
  cBlueBits:0;
  cBlueShift:0;
  cAlphaBits:0;
  cAlphaShift:0;   // no alpha buffer
  cAccumBits: 0;
  cAccumRedBits: 0;          // no accumulation buffer,
  cAccumGreenBits: 0;             // accum bits (ignored)
  cAccumBlueBits: 0;
  cAccumAlphaBits: 0;
    cDepthBits:24;                // depth buffer
    cStencilBits:0;                // no stencil buffer
    cAuxBuffers:0;                // no auxiliary buffers
    iLayerType:PFD_MAIN_PLANE;              // main layer
  bReserved: 0;
  dwLayerMask: 0;
  dwVisibleMask: 0;
  dwDamageMask: 0;                    // no layer, visible, damage masks */
    );
var pixelFormat:integer;
begin
  pixelFormat := ChoosePixelFormat(DC, @pfd);
  if (pixelFormat = 0) then begin
    MessageBox(WindowFromDC(DC), 'ChoosePixelFormat failed.', 'Error',
        MB_ICONERROR or MB_OK);
    exit;
  end;
  if (SetPixelFormat(DC, pixelFormat, @pfd) <> TRUE) then begin
    MessageBox(WindowFromDC(DC), 'SetPixelFormat failed.', 'Error',
        MB_ICONERROR or MB_OK);
    exit;
  end;
end;


i kod kreiranja forme pozoves
SetupGLWindow(Panel1);
22.10.2006. u 22:00 

Trodmi

Član broj: 58036
Poruke: 166
*.dialup.neobee.net.



Profil

icon Re: Opengl na odredjenom delu forme26.10.2006. u 11:29
All right, a kako sada da mi pozadina bude u boji panela, tj da ne bude crna.
26.10.2006. u 11:29 

Srki_82
Srdjan Tot
Me @ My Home
Ljubljana

Član broj: 28226
Poruke: 1402
82.208.201.*

ICQ: 246436949


Profil

icon Re: Opengl na odredjenom delu forme26.10.2006. u 12:40
Vrlo jednostavno. Postavi ClearColor na boju forme, i kad god budes brisao RT, boja brisanja ce biti boja forme.
DirectX na srpskom | GLScene na srpskom

There are only 10 types of people in this world; those who understand binary and those who don't.
26.10.2006. u 12:40 

[es] :: Pascal / Delphi / Kylix :: Opengl na odredjenom delu forme

[ Pregleda: 1119 | Odgovora: 5 ]

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.