您好,登錄后才能下訂單哦!
這期內容當中小編將會給大家帶來有關OpenGL庫函數有哪些,文章內容豐富且以專業的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
OpenGL函數庫相關的API有核心庫(gl)、實用庫(glu)、輔助庫(aux)、實用工具庫(glut)、窗口庫(glx、agl、wgl)和擴展函數庫等。從圖可以看出,gl是核心,glu是對gl的部分封裝。glx、agl、wgl 是針對不同窗口系統的函數。glut是為跨平臺的OpenGL程序的工具包,比aux功能強大。擴展函數庫是硬件廠商為實現硬件更新利用OpenGL的擴展機制開發的函數。
目前OpenGL的函數主要包含在3個庫中:GL 函數庫、GLU 函數庫、GLUT 函數庫
顏色編輯 | glShadeModel,glColor,glColorPointer,glIndex,glIndexPointer,glColorTableEXT,glColorSubTableEXT |
繪制幾何圖形 | glVertex,glVertexPointer,glArrayElement,glBegin , glEnd,glEdgeFlag , glEdgeFlagv,glPointSize,glLineWidth,glLineStipple,glPolygonMode,glFrontFace,glPolygonStipple,glDrawElements,glRect |
坐標轉換 | glTranslate,glRotate,glScale,glViewPoint,glFrustum,glOrtho,glClipPlane |
堆棧操作 | glLoadMatrix,glMultMatrix,glMatrixMode,glPushMatrix , glPopMatrix,glPushAttrib , glPopAttrib,glPushName , glPopName,glInitName ,glLoadName |
顯示列表 | glNewList , glEndList,glCallList,glCallLists,glGenLists,glDeleteLists, |
使用光照和材質 | glNormal,glNormalPointer,glLight,glLightModel,glMaterial,glColorMaterial, |
像素操作 | glRasterPos,glBitmap,glReadPixels,glDrawPixels,glCopyPixels,glCopyTexImage1D,glCopyTexImage2D,glCopyTexSubImage1D,glCopyTexSubImage2D,glPixelZoom,glPixelStore,glPixelTransfer,glPixelMap |
紋理映射 | glTexImage1D,glTexImage2D,glTexParameter,glTexSubImage1D,glTexSubImage2D,glTexEnv,glTexCoord,glTexGen,glTexCoordPointer,glDeleteTextures, |
特效操作 | glBlendFunc,glHint,glFog |
幀緩存操作 | glClear,glClearAccum,glClearColor,glClearDepth,glClearIndex,glClearStencil,glDrawBuffer,glIndexMask,glColorMask,glDepthMask,glStencilMask,glAlphaFunc,glStencilFunc,glStencilOp,glDepthFunc,glDepthRange,glLogicOp,glAccum, |
曲線或曲面繪制 | glEvalCoord,glMap1,glMap2,glMapGrid,glEvalMesh,glEvalPoint, |
查詢函數 | glGet,glGetClipPlane,glGetColorTableEXT,glGetColorTableParameterfvEXT , glGetColorTableParameterivEXT,glGetError,glGetLight,glGetMap,glGetMaterial,glGetPixelMap,glGetPointerv,glGetPolygonStipple,glGetString,glGetTexEnv,glGetTexImage,glGetTexLevelParameter,glGetTexParameter, |
包含有43個函數,函數名的前綴為glu。OpenGL提供了強大的但是為數不多的繪圖命令,所有較復雜的繪圖都必須從點、線、面開始。Glu 為了減輕繁重的編程工作,封裝了OpenGL函數,Glu函數通過調用核心庫的函數,為開發者提供相對簡單的用法,實現一些較為復雜的操作。此函數由glu.dll來負責解釋執行。OpenGL中的核心庫和實用庫可以在所有的OpenGL平臺上運行。
繪制 NURBS 曲線和曲面 | gluNewNurbsRenderer,gluNurbsProperty,gluNurbsCallback,gluBeginCurve , gluEndCurve,gluNurbsCurve,gluDeleteNurbsRenderer,gluBeginSurface , gluEndSurface,gluNurbsSurface,gluBeginTrim , gluEndTrim,gluPwlCurve,gluBeginPolygon , gluEndPolygon,gluPickMatrix |
繪制二次幾何物體 | gluNewQuadric,gluQuadricDrawStyle,gluQuadricNormals,gluQuadricOrientation,gluCylinder,gluSphere,gluDisk,gluPartialDisk,gluDeleteQuadric,gluQuadricTexture,gluQuadricCallback |
網格化 | gluNewTess,gluTessVertex,gluTessCallback,gluTessBeginPolygon , gluTessEndPolygon,gluTessBeginContour , gluTessBeginContour,gluTessProperty,gluNextContour,gluTessNormal,gluDeleteTess |
坐標轉換 | gluOrtho2D,gluPerspective,gluLookAt,gluProject,gluUnProject |
多重映射 | gluBuild1DMipmaps,gluBuild2DMipmaps,gluScaleImage |
查詢函數 | gluErrorString,gluGetNurbsProperty,gluGetString,gluGetTessProperty |
包含大約30多個函數,函數名前綴為glut。glut是不依賴于窗口平臺的OpenGL工具包,由Mark KLilgrad在SGI編寫(現在在Nvidia),目的是隱藏不同窗口平臺API的復雜度。 函數以glut開頭,它們作為aux庫功能更強的替代品,提供更為復雜的繪制功能,此函數由glut.dll來負責解釋執行。由于glut中的窗口管理函數是不依賴于運行環境的,因此OpenGL中的工具庫可以在X-Window, Windows NT, OS/2等系統下運行,特別適合于開發不需要復雜界面的OpenGL示例程序。對于有經驗的程序員來說,一般先用glut理順3D圖形代碼,然后再集成為完整的應用程序。
初始化和啟動事件處理 | glutInit,glutInitWindowPosition,glutInitWindowSize,glutInitDisplayMode,glutMainLoop, |
窗口管理 | glutCreateWindow,glutCreateSubWindow,glutHideWindow,glutShowWindow,glutSetWindowTitle,glutPostRedisplay,glutSwapBuffers,glutFullScreen,glutPositionWindow,glutReshapeWindow,glutSetWindow,glutGetWindow,glutPopWindow,glutPushWindow,glutDestroyWindow,glutIconifyWindow,glutSetCursor, |
重疊層管理 | glutEstablishOverlay,glutUseLayer,glutRemoveOverlay,glutPostOverlayRedisplay,glutShowOverlay,glutHideOverlay, |
菜單管理 | glutCreateMenu,glutAddMenuEntry,glutAddSubMenu,glutAttachMenu,glutGetMenu,glutSetMenu,glutDestroyMenu,glutChangeToMenuEntry,glutChangeToSubMenu,glutRemoveMenuItem,glutDetachMenu, |
注冊回調函數 | glutDisplayFunc,glutReshapeFunc,glutMouseFunc,glutMotionFunc,glutIdleFunc,glutVisibilityFunc,glutKeyboardFunc,glutSpecialFunc,glutOverlayDisplayFunc,glutPassiveMotionFunc,glutEntryFunc,glutSpaceballMotionFunc,glutSpaceballRotateFunc,glutSpaceballButtonFunc,glutButtonBoxFunc,glutDialsFunc,glutTableMotionFunc,glutTableButtonFunc,glutMenuStatusFunc,glutTimerFunc |
顏色索引映射表管理 | glutSetColor,glutGetColor,glutCopyColormap, |
狀態檢索 | glutGet,glutLayerGet,glutDeviceGet,glutGetModifiers,glutExtensionSupported, |
字體繪制 | glutBitmapCharacter,glutBitmapWidth,glutStrokeCharacter,glutStrokeWidth, |
幾何圖形繪制 | glutSolidSphere , glutWireSphere,glutSolidCube , glutWireCube,glutSolidCone , glutWireCone,glutSolidTorus , glutWireTorus,glutSolidDodecahedron , glutWireDodecahedron,glutSolidOctahedron , glutWireOctahedron,glutSolidTetrahedron , glutWireTetrahedron,glutSolieIcosahedron , glutWireIcosahedron,glutSolidTeapot , glutWireTeapot, |
上述就是小編為大家分享的OpenGL庫函數有哪些了,如果剛好有類似的疑惑,不妨參照上述分析進行理解。如果想知道更多相關知識,歡迎關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。