资源描述:
《OpenGL是一种APl,不是语言 毕业论文外文翻译》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、英文原文:OpenGL:AnAPI,NotaLanguageForthemostpart,OpenGLisnotaprogramminglanguage;itisanapplicationprogramminginterface(API).WheneverwesaythataprogramisOpenGL-basedoranOpenGLapplication,wemeanthatitwaswritteninsomeprogramminglanguage(suchasCorC++)thatmakescallstooneorm
2、oreoftheOpenGLlibraries.WearenotsayingthattheprogramusesOpenGLexclusivelytododrawing.Itmightcombinethebestfeaturesoftwodifferentgraphicspackages.OritmightuseOpenGLforonlyafewspecifictasksandenvironment-specificgraphics(suchastheWindowsGDI)forothers.Theonlyexceptio
3、ntothisruleofthumbis,ofcourse,theOpenGLShadingLanguage,whichiscoveredinPartII.AsanAPI,theOpenGLlibraryfollowstheCcallingconvention.Asitturnsout,thischoiceofcallingconventionmakesitpossibletoeasilycallOpenGLdirectlyfrommostotherlanguagesaswell.Inthisbook,thesamplep
4、rogramsarewritteninC++.C++programscaneasilyaccessCfunctionsandAPIsinthesamemannerasC,withonlysomeminorconsiderations.C++isthemodernlanguageofchoiceformostperformancemindedapplications.VerybasicC++classescandramaticallysimplifymostprogrammingtasksaswell.Wepromiseto
5、keeptheobjectusagetoaminimum,noSTL/Template/OperatorOverloaded/Metablahblah…wepromise!Otherprogramminglanguages—suchasVisualBasic—thatcancallfunctionsinClibrariescanalsomakeuseofOpenGL,andOpenGLbindingsareavailableformanyotherprogramminglanguages.UsingOpenGLfromth
6、eseotherlanguagesis,however,outsidethescopeofthisbookandcanbesomewhattedioustoexplain.Tokeepthingssimpleandeasilyportable,we’llstickwithC++forourexamples.StandardLibrariesandHeadersAlthoughOpenGLisa“standard”programminglibrary,thislibraryhasmanyimplementationsandv
7、ersions.OnMicrosoftWindows,forexample,theactualMicrosoftsoftwareimplementationisintheopengl32.dlldynamiclinklibrary,locatedintheWindowssystemdirectory.Onmostplatforms,theOpenGLlibraryisaccompaniedbytheOpenGLutilitylibrary(GLU),whichonWindowsisinglu32.dll,alsolocat
8、edinthesystemdirectory.Theutilitylibraryisasetofutilityfunctionsthatperformcommon(butsometimescomplex)tasks,suchasspecialmatrixcalculations,orprovidesup