AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Bild in opengl_würfel

Ein Thema von Poseidon · begonnen am 15. Okt 2008 · letzter Beitrag vom 15. Okt 2008
Antwort Antwort
Benutzerbild von littleDave
littleDave

Registriert seit: 27. Apr 2006
Ort: München
556 Beiträge
 
Delphi 7 Professional
 
#1

Re: Bild in opengl_würfel

  Alt 15. Okt 2008, 20:09
TexID ist ein cardinal - kannst also auch direkt cardinal oder DWORD hinschreiben.

Ach noch was: wenn du die dglOpenGL.pas benutzt, kannst du das "SetupPixelFormat" von der Unit übernehmen lassen und die Funktion bei dir rauslöschen.

In der Readme.html seht geschrieben
Before you can use any of the gl-functions contained in the header, you'll have to call InitOpenGL to initialize the functionpointers. In your app it should look something like that :

Delphi-Quellcode:
procedure MyGLInit;
begin
  InitOpenGL; // Don't forget, or first gl-Call will result in an access violation!
  MyDC := GetDC(...);
  MyRC := CreateRenderingContext(...);
  ActivateRenderingContext(MyDC, MyRC); // Necessary, will also read some extension
  ...
end;
After doing the above initialisation, you're ready to use all OpenGL-Functions and extensions your card supports. And also don't forget to release your context properly when exiting :

Delphi-Quellcode:
procedure MyDeInit;
begin
  DeactivateRenderingContext; // Deactivates the current context
  wglDeleteContext(myRC);
  ReleaseDC(Handle, myDC);
end;


Dein FormCreate-Event ist dann zwar nicht viel kleiner, jedoch fällt die komplette "SetupPixelFormat" aus deinem Source weg.
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  InitOpenGL;

  MyDC := GetDC(Handle);
  MyRC := CreateRenderingContext(MyDC, [opDoubleBuffered], 32, 24, 0, 0, 0, 0);
  ActiveRenderingContext(MyDC, MyRC);
end;
Jabber: littleDave@jabber.org
in case of 1 is 0 do external raise while in public class of object array else repeat until 1 is 0
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:22 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz