Solved

OpenGL and Delphi

Posted on 1997-09-17
1
482 Views
Last Modified: 2010-04-03
I've been trying to use the OpenGL libraries as shipped with  win95 OSR2 with D3 and it isn't playing. The problem I'm getting is that the creation of the rendering context is failing. Has anyone got any ideas of what is going wrong.

Also, does anyone know where I can find a version of the glaux libraries for Delphi or C++ Builder? (preferably both)

Thanks

 Adam
0
Comment
Question by:AJFleming
1 Comment
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 200 total points
ID: 1345324
I presume the call that's failing is the call to wglCreateContext.

If so, try the following BEFORE the call to wglCreateContext:
1)  Declare the following variables:
  pfd: TPixelFormatDescriptor;
  nPixelFormat: Integer;

2) Execute the following code:
  FillChar(pfd, SizeOf(pfd), 0);
 
  with pfd do
    begin
      nSize     := sizeof(pfd);
      nVersion  := 1;
      dwFlags   := PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL;
      iPixelType:= PFD_TYPE_RGBA;
      cColorBits:= 24;
      cDepthBits:= 32;
      iLayerType:= PFD_MAIN_PLANE;
    end;
 
  nPixelFormat := ChoosePixelFormat(MyCanvas.Handle, @pfd);
  SetPixelFormat(MyCanvas.Handle, nPixelFormat, @pfd);

3) Now call wglCreateContext:
  hrc := wglCreateContext(MyCanvas.Handle);

0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question