Solved

OpenGL and Delphi

Posted on 1997-09-17
1
505 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

729 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