Solved

OpenGL and Delphi

Posted on 1997-09-17
1
467 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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now