Solved

OpenGL and Delphi

Posted on 1997-09-17
1
488 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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