Click here to Skip to main content
15,894,343 members
Articles / Desktop Programming / ATL

How to add OpenGL support to ATL controls

Rate me:
Please Sign up or sign in to vote.
4.57/5 (7 votes)
28 Sep 2002CPOL2 min read 111.9K   1.4K   44  
An article describing the step-by-step process of adding basic OpenGL support to an ATL control
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=windows-1251">
</head>
<body>
<pre>
<table width=100% bgcolor=#CFCFE5><tr> <td> <font face=arial size=+3>
Build Log
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>
<h3>------- Build started: Project: MyProject, Configuration: Release|Win32 -------
</h3>
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
Environment Space
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>    ALLUSERSPROFILE=C:\Documents and Settings\All Users
    APPDATA=C:\Documents and Settings\Dima\Application Data
    Basemake=D:\Program Files\Microsoft SDK\Include\BKOffice.Mak
    Bkoffice=D:\Program Files\Microsoft SDK\.
    classpath=c:\jdk1.4\lib;.
    COMMONHOME=C:\Program Files\FlexLM\common
    CommonProgramFiles=C:\Program Files\Common Files
    COMPUTERNAME=EUROPA
    ComSpec=C:\WINDOWS\system32\cmd.exe
    DXSDKROOT=D:\Program Files\Microsoft SDK\.
    HOME=C:\Documents and Settings\Dima
    HOMEDRIVE=C:
    HOMEPATH=\Documents and Settings\Dima
    INCLUDE=D:\Program Files\pl\include;C:\jdk1.4\include;C:\Program Files\HTML Help Workshop\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;
    INETSDK=D:\Program Files\Microsoft SDK\.
    LIB=D:\Program Files\pl\lib;C:\jdk1.4\lib;C:\Program Files\HTML Help Workshop\lib;C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\lib;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib\prerelease;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\lib;
    LIBPATH=
    LOGONSERVER=\\EUROPA
    MAYA_SHADER_LIBRARY_PATH=c:\program files\ShaderLibrary\shaders
    MGAPIDIST=d:\program files\multigen\mgapi
    MSSdk=D:\Program Files\Microsoft SDK\.
    Mstools=D:\Program Files\Microsoft SDK\.
    NUMBER_OF_PROCESSORS=1
    NUTCROOT=C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT
    NUTSUFFIX=1
    NUT_SUFFIXED_SEARCHING=1
    OS=Windows_NT
    Path=C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin;C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio .NET\Common7\tools;C:\Program Files\Microsoft Visual Studio .NET\Common7\ide;C:\Program Files\HTML Help Workshop\;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705;C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT\bin;C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT\bin\x11;C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT\mksnt;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\Borland\Delphi6\Bin;C:\PROGRA~1\Borland\Delphi6\Projects\Bpl;C:\Program Files\FlexLM\common;C:\Program Files\FlexLM\Rational Test;c:\program files\Maya4\bin;
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.py;.pyw;.pyc;.pys
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 4 Stepping 2, AuthenticAMD
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=0402
    ProgramFiles=C:\Program Files
    RQAHOME=C:\Program Files\FlexLM\Rational Test\QualityArchitect
    RTHOME=C:\Program Files\FlexLM\Rational Test
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\WINDOWS
    TEMP=C:\DOCUME~1\Dima\LOCALS~1\Temp
    TERM=nutc
    TERMCAP=C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT\etc\termcap
    TERMINFO=C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT\usr\lib\terminfo
    TMP=C:\DOCUME~1\Dima\LOCALS~1\Temp
    TMPDIR=C:\DOCUME~1\Dima\LOCALS~1\Temp
    USERDOMAIN=EUROPA
    USERNAME=Dima
    USERPROFILE=C:\Documents and Settings\Dima
    VSCOMNTOOLS="C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\"
    windir=C:\WINDOWS
    _ACP_ATLPROV=C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin\ATLPROV.DLL
    _ACP_INCLUDE=D:\Program Files\pl\include;C:\jdk1.4\include;C:\Program Files\HTML Help Workshop\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;
    _ACP_LIB=D:\Program Files\pl\lib;C:\jdk1.4\lib;C:\Program Files\HTML Help Workshop\lib;C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\lib;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib\prerelease;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\lib;;D:\Program Files\pl\include;C:\jdk1.4\include;C:\Program Files\HTML Help Workshop\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;
    _ACP_PATH=C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin;C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin\prerelease;C:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio .NET\Common7\tools;C:\Program Files\Microsoft Visual Studio .NET\Common7\ide;C:\Program Files\HTML Help Workshop\;C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705;C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT\bin;C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT\bin\x11;C:\PROGRA~1\FLEXLM\RATION~1\NUTCROOT\mksnt;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\Borland\Delphi6\Bin;C:\PROGRA~1\Borland\Delphi6\Projects\Bpl;C:\Program Files\FlexLM\common;C:\Program Files\FlexLM\Rational Test;c:\program files\Maya4\bin;
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
Command Lines
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>Creating temporary file "c:\Documents and Settings\Dima\My Documents\Visual Studio Projects\Atl OpenGL Demo\MyProject\Release\RSP00001B.rsp" with contents
[
/O2 /Ob1 /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "_USRDLL" /D "_ATL_STATIC_REGISTRY" /D "_MBCS" /D "_WINDLL" /GF /FD /EHsc /MD /GS /Gy /Yu"stdafx.h" /Fp"Release/MyProject.pch" /Fo"Release/" /Fd"Release/vc70.pdb" /W3 /c /Wp64 /Zi /TP
"MyControl.cpp"
]
Creating command line "cl.exe @"c:\Documents and Settings\Dima\My Documents\Visual Studio Projects\Atl OpenGL Demo\MyProject\Release\RSP00001B.rsp" /nologo"
Creating temporary file "c:\Documents and Settings\Dima\My Documents\Visual Studio Projects\Atl OpenGL Demo\MyProject\Release\RSP00001C.rsp" with contents
[
/OUT:"Release/MyProject.dll" /INCREMENTAL:NO /NOLOGO /DLL /DEF:".\MyProject.def" /DEBUG /PDB:"Release/MyProject.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /IMPLIB:"Release/MyProject.lib" /MACHINE:IX86  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
"release\stdafx.obj"
"release\MyProject.obj"
"release\MyProject.res"
"release\MyProject_i.obj"
"release\MyControl.obj"
]
Creating command line "link.exe @"c:\Documents and Settings\Dima\My Documents\Visual Studio Projects\Atl OpenGL Demo\MyProject\Release\RSP00001C.rsp""
Creating temporary file "c:\Documents and Settings\Dima\My Documents\Visual Studio Projects\Atl OpenGL Demo\MyProject\Release\BAT00001D.bat" with contents
[
@echo off
regsvr32 /s /c "c:\documents and settings\dima\my documents\visual studio projects\atl opengl demo\myproject\release\MyProject.dll"
if errorlevel 1 goto VCReportError
goto VCEnd
:VCReportError
echo Project : error PRJ0019: A tool returned an error code: "Performing registration"
exit 1
:VCEnd
]
Creating command line ""c:\Documents and Settings\Dima\My Documents\Visual Studio Projects\Atl OpenGL Demo\MyProject\Release\BAT00001D.bat""
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
Output Window
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>Compiling...
MyControl.cpp
Linking...
   Creating library Release/MyProject.lib and object Release/MyProject.exp
Performing registration
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
Results
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5>&nbsp;</td><td width=0 bgcolor=#FFFFFF>&nbsp;</td><td width=*><pre>
Build log was saved at "file://c:\Documents and Settings\Dima\My Documents\Visual Studio Projects\Atl OpenGL Demo\MyProject\Release\BuildLog.htm"
MyProject - 0 error(s), 0 warning(s)</pre></table><table   width=100% height=20 bgcolor=#CFCFE5><tr><td><font face=arial size=+2>
</font></table></body></html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder ActiveMesa
United Kingdom United Kingdom
I work primarily with the .NET technology stack, and specialize in accelerated code production via code generation (static or dynamic), aspect-oriented programming, MDA, domain-specific languages and anything else that gets products out the door faster. My languages of choice are C# and C++, though I'm open to suggestions.

Comments and Discussions