⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 glut.pas

📁 一款RPG游戏的引擎可以自己制作一款RPG游戏的引擎可以自己制作
💻 PAS
📖 第 1 页 / 共 2 页
字号:
  glutDialsFunc: procedure(f: TGlut2IntCallback); stdcall;
  glutTabletMotionFunc: procedure(f: TGlut2IntCallback); stdcall;
  glutTabletButtonFunc: procedure(f: TGlut4IntCallback); stdcall;
  glutMenuStatusFunc: procedure(f: TGlut3IntCallback); stdcall;
  glutOverlayDisplayFunc: procedure(f:TGlutVoidCallback); stdcall;
  glutWindowStatusFunc: procedure(f: TGlut1IntCallback); stdcall;

// GLUT color index sub-API.
  glutSetColor: procedure(cell: Integer; red, green, blue: GLfloat); stdcall;
  glutGetColor: function(ndx, component: Integer): GLfloat; stdcall;
  glutCopyColormap: procedure(win: Integer); stdcall;

// GLUT state retrieval sub-API.
  glutGet: function(t: GLenum): Integer; stdcall;
  glutDeviceGet: function(t: GLenum): Integer; stdcall;

// GLUT extension support sub-API
  glutExtensionSupported: function(const name: PChar): Integer; stdcall;
  glutGetModifiers: function: Integer; stdcall;
  glutLayerGet: function(t: GLenum): Integer; stdcall;

// GLUT font sub-API
  glutBitmapCharacter: procedure(font, character: Integer); stdcall;
  glutBitmapWidth: function(font, character: Integer): Integer; stdcall;
  glutStrokeCharacter: procedure(font, character: Integer); stdcall;
  glutStrokeWidth: function(font, character: Integer): Integer; stdcall;
  glutBitmapLength: function(font: Integer; const str: PChar): Integer; stdcall;
  glutStrokeLength: function(font: Integer; const str: PChar): Integer; stdcall;

// GLUT pre-built models sub-API
  glutWireSphere: procedure(radius: GLdouble; slices, stacks: GLint); stdcall;
  glutSolidSphere: procedure(radius: GLdouble; slices, stacks: GLint); stdcall;
  glutWireCone: procedure(base, height: GLdouble; slices, stacks: GLint); stdcall;
  glutSolidCone: procedure(base, height: GLdouble; slices, stacks: GLint); stdcall;
  glutWireCube: procedure(size: GLdouble); stdcall;
  glutSolidCube: procedure(size: GLdouble); stdcall;
  glutWireTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint); stdcall;
  glutSolidTorus: procedure(innerRadius, outerRadius: GLdouble; sides, rings: GLint); stdcall;
  glutWireDodecahedron: procedure; stdcall;
  glutSolidDodecahedron: procedure; stdcall;
  glutWireTeapot: procedure(size: GLdouble); stdcall;
  glutSolidTeapot: procedure(size: GLdouble); stdcall;
  glutWireOctahedron: procedure; stdcall;
  glutSolidOctahedron: procedure; stdcall;
  glutWireTetrahedron: procedure; stdcall;
  glutSolidTetrahedron: procedure; stdcall;
  glutWireIcosahedron: procedure; stdcall;
  glutSolidIcosahedron: procedure; stdcall;

// GLUT video resize sub-API.
  glutVideoResizeGet: function(param: GLenum): Integer; stdcall;
  glutSetupVideoResizing: procedure; stdcall;
  glutStopVideoResizing: procedure; stdcall;
  glutVideoResize: procedure(x, y, width, height: Integer); stdcall;
  glutVideoPan: procedure(x, y, width, height: Integer); stdcall;

// GLUT debugging sub-API.
  glutReportErrors: procedure; stdcall;

implementation

var
  hDLL: THandle;

procedure FreeGlut;
begin

  FreeLibrary(hDLL);

  @glutInit := nil;
  @glutInitDisplayMode := nil;
  @glutInitDisplayString := nil;
  @glutInitWindowPosition := nil;
  @glutInitWindowSize := nil;
  @glutMainLoop := nil;
  @glutCreateWindow := nil;
  @glutCreateSubWindow := nil;
  @glutDestroyWindow := nil;
  @glutPostRedisplay := nil;
  @glutPostWindowRedisplay := nil;
  @glutSwapBuffers := nil;
  @glutGetWindow := nil;
  @glutSetWindow := nil;
  @glutSetWindowTitle := nil;
  @glutSetIconTitle := nil;
  @glutPositionWindow := nil;
  @glutReshapeWindow := nil;
  @glutPopWindow := nil;
  @glutPushWindow := nil;
  @glutIconifyWindow := nil;
  @glutShowWindow := nil;
  @glutHideWindow := nil;
  @glutFullScreen := nil;
  @glutSetCursor := nil;
  @glutWarpPointer := nil;
  @glutEstablishOverlay := nil;
  @glutRemoveOverlay := nil;
  @glutUseLayer := nil;
  @glutPostOverlayRedisplay := nil;
  @glutPostWindowOverlayRedisplay := nil;
  @glutShowOverlay := nil;
  @glutHideOverlay := nil;
  @glutCreateMenu := nil;
  @glutDestroyMenu := nil;
  @glutGetMenu := nil;
  @glutSetMenu := nil;
  @glutAddMenuEntry := nil;
  @glutAddSubMenu := nil;
  @glutChangeToMenuEntry := nil;
  @glutChangeToSubMenu := nil;
  @glutRemoveMenuItem := nil;
  @glutAttachMenu := nil;
  @glutDetachMenu := nil;
  @glutDisplayFunc := nil;
  @glutReshapeFunc := nil;
  @glutKeyboardFunc := nil;
  @glutMouseFunc := nil;
  @glutMotionFunc := nil;
  @glutPassiveMotionFunc := nil;
  @glutEntryFunc := nil;
  @glutVisibilityFunc := nil;
  @glutIdleFunc := nil;
  @glutTimerFunc := nil;
  @glutMenuStateFunc := nil;
  @glutSpecialFunc := nil;
  @glutSpaceballMotionFunc := nil;
  @glutSpaceballRotateFunc := nil;
  @glutSpaceballButtonFunc := nil;
  @glutButtonBoxFunc := nil;
  @glutDialsFunc := nil;
  @glutTabletMotionFunc := nil;
  @glutTabletButtonFunc := nil;
  @glutMenuStatusFunc := nil;
  @glutOverlayDisplayFunc := nil;
  @glutWindowStatusFunc := nil;
  @glutSetColor := nil;
  @glutGetColor := nil;
  @glutCopyColormap := nil;
  @glutGet := nil;
  @glutDeviceGet := nil;
  @glutExtensionSupported := nil;
  @glutGetModifiers := nil;
  @glutLayerGet := nil;
  @glutBitmapCharacter := nil;
  @glutBitmapWidth := nil;
  @glutStrokeCharacter := nil;
  @glutStrokeWidth := nil;
  @glutBitmapLength := nil;
  @glutStrokeLength := nil;
  @glutWireSphere := nil;
  @glutSolidSphere := nil;
  @glutWireCone := nil;
  @glutSolidCone := nil;
  @glutWireCube := nil;
  @glutSolidCube := nil;
  @glutWireTorus := nil;
  @glutSolidTorus := nil;
  @glutWireDodecahedron := nil;
  @glutSolidDodecahedron := nil;
  @glutWireTeapot := nil;
  @glutSolidTeapot := nil;
  @glutWireOctahedron := nil;
  @glutSolidOctahedron := nil;
  @glutWireTetrahedron := nil;
  @glutSolidTetrahedron := nil;
  @glutWireIcosahedron := nil;
  @glutSolidIcosahedron := nil;
  @glutVideoResizeGet := nil;
  @glutSetupVideoResizing := nil;
  @glutStopVideoResizing := nil;
  @glutVideoResize := nil;
  @glutVideoPan := nil;
  @glutReportErrors := nil;

end;

procedure LoadGlut(const dll: String);
begin

  FreeGlut;

  hDLL := LoadLibrary(PChar(dll));
  if hDLL = 0 then raise Exception.Create('Could not load Glut from ' + dll);

  @glutInit := GetProcAddress(hDLL, 'glutInit');
  @glutInitDisplayMode := GetProcAddress(hDLL, 'glutInitDisplayMode');
  @glutCreateWindow := GetProcAddress(hDLL, 'glutCreateWindow');
  @glutCreateSubWindow := GetProcAddress(hDLL, 'glutCreateSubWindow');
  @glutDestroyWindow := GetProcAddress(hDLL, 'glutDestroyWindow');
  @glutPostRedisplay := GetProcAddress(hDLL, 'glutPostRedisplay');
  @glutPostWindowRedisplay := GetProcAddress(hDLL, 'glutPostWindowRedisplay');
  @glutSwapBuffers := GetProcAddress(hDLL, 'glutSwapBuffers');
  @glutGetWindow := GetProcAddress(hDLL, 'glutGetWindow: Integer');
  @glutSetWindow := GetProcAddress(hDLL, 'glutSetWindow');
  @glutSetWindowTitle := GetProcAddress(hDLL, 'glutSetWindowTitle');
  @glutSetIconTitle := GetProcAddress(hDLL, 'glutSetIconTitle');
  @glutPositionWindow := GetProcAddress(hDLL, 'glutPositionWindow');
  @glutReshapeWindow := GetProcAddress(hDLL, 'glutReshapeWindow');
  @glutPopWindow := GetProcAddress(hDLL, 'glutPopWindow');
  @glutPushWindow := GetProcAddress(hDLL, 'glutPushWindow');
  @glutIconifyWindow := GetProcAddress(hDLL, 'glutIconifyWindow');
  @glutShowWindow := GetProcAddress(hDLL, 'glutShowWindow');
  @glutHideWindow := GetProcAddress(hDLL, 'glutHideWindow');
  @glutFullScreen := GetProcAddress(hDLL, 'glutFullScreen');
  @glutSetCursor := GetProcAddress(hDLL, 'glutSetCursor');
  @glutWarpPointer := GetProcAddress(hDLL, 'glutWarpPointer');
  @glutEstablishOverlay := GetProcAddress(hDLL, 'glutEstablishOverlay');
  @glutRemoveOverlay := GetProcAddress(hDLL, 'glutRemoveOverlay');
  @glutUseLayer := GetProcAddress(hDLL, 'glutUseLayer');
  @glutPostOverlayRedisplay := GetProcAddress(hDLL, 'glutPostOverlayRedisplay');
  @glutPostWindowOverlayRedisplay := GetProcAddress(hDLL, 'glutPostWindowOverlayRedisplay');
  @glutShowOverlay := GetProcAddress(hDLL, 'glutShowOverlay');
  @glutHideOverlay := GetProcAddress(hDLL, 'glutHideOverlay');
  @glutCreateMenu := GetProcAddress(hDLL, 'glutCreateMenu');
  @glutDestroyMenu := GetProcAddress(hDLL, 'glutDestroyMenu');
  @glutGetMenu := GetProcAddress(hDLL, 'glutGetMenu: Integer');
  @glutSetMenu := GetProcAddress(hDLL, 'glutSetMenu');
  @glutAddMenuEntry := GetProcAddress(hDLL, 'glutAddMenuEntry');
  @glutAddSubMenu := GetProcAddress(hDLL, 'glutAddSubMenu');
  @glutChangeToMenuEntry := GetProcAddress(hDLL, 'glutChangeToMenuEntry');
  @glutChangeToSubMenu := GetProcAddress(hDLL, 'glutChangeToSubMenu');
  @glutRemoveMenuItem := GetProcAddress(hDLL, 'glutRemoveMenuItem');
  @glutAttachMenu := GetProcAddress(hDLL, 'glutAttachMenu');
  @glutDetachMenu := GetProcAddress(hDLL, 'glutDetachMenu');
  @glutDisplayFunc := GetProcAddress(hDLL, 'glutDisplayFunc');
  @glutReshapeFunc := GetProcAddress(hDLL, 'glutReshapeFunc');
  @glutKeyboardFunc := GetProcAddress(hDLL, 'glutKeyboardFunc');
  @glutMouseFunc := GetProcAddress(hDLL, 'glutMouseFunc');
  @glutMotionFunc := GetProcAddress(hDLL, 'glutMotionFunc');
  @glutPassiveMotionFunc := GetProcAddress(hDLL, 'glutPassiveMotionFunc');
  @glutEntryFunc := GetProcAddress(hDLL, 'glutEntryFunc');
  @glutVisibilityFunc := GetProcAddress(hDLL, 'glutVisibilityFunc');
  @glutIdleFunc := GetProcAddress(hDLL, 'glutIdleFunc');
  @glutTimerFunc := GetProcAddress(hDLL, 'glutTimerFunc');
  @glutMenuStateFunc := GetProcAddress(hDLL, 'glutMenuStateFunc');
  @glutSpecialFunc := GetProcAddress(hDLL, 'glutSpecialFunc');
  @glutSpaceballMotionFunc := GetProcAddress(hDLL, 'glutSpaceballMotionFunc');
  @glutSpaceballRotateFunc := GetProcAddress(hDLL, 'glutSpaceballRotateFunc');
  @glutSpaceballButtonFunc := GetProcAddress(hDLL, 'glutSpaceballButtonFunc');
  @glutButtonBoxFunc := GetProcAddress(hDLL, 'glutButtonBoxFunc');
  @glutDialsFunc := GetProcAddress(hDLL, 'glutDialsFunc');
  @glutTabletMotionFunc := GetProcAddress(hDLL, 'glutTabletMotionFunc');
  @glutTabletButtonFunc := GetProcAddress(hDLL, 'glutTabletButtonFunc');
  @glutMenuStatusFunc := GetProcAddress(hDLL, 'glutMenuStatusFunc');
  @glutOverlayDisplayFunc := GetProcAddress(hDLL, 'glutOverlayDisplayFunc');
  @glutWindowStatusFunc := GetProcAddress(hDLL, 'glutWindowStatusFunc');
  @glutSetColor := GetProcAddress(hDLL, 'glutSetColor');
  @glutGetColor := GetProcAddress(hDLL, 'glutGetColor');
  @glutCopyColormap := GetProcAddress(hDLL, 'glutCopyColormap');
  @glutGet := GetProcAddress(hDLL, 'glutGet');
  @glutDeviceGet := GetProcAddress(hDLL, 'glutDeviceGet');
  @glutExtensionSupported := GetProcAddress(hDLL, 'glutExtensionSupported');
  @glutGetModifiers := GetProcAddress(hDLL, 'glutGetModifiers: Integer');
  @glutLayerGet := GetProcAddress(hDLL, 'glutLayerGet');
  @glutBitmapCharacter := GetProcAddress(hDLL, 'glutBitmapCharacter');
  @glutBitmapWidth := GetProcAddress(hDLL, 'glutBitmapWidth');
  @glutStrokeCharacter := GetProcAddress(hDLL, 'glutStrokeCharacter');
  @glutStrokeWidth := GetProcAddress(hDLL, 'glutStrokeWidth');
  @glutBitmapLength := GetProcAddress(hDLL, 'glutBitmapLength');
  @glutStrokeLength := GetProcAddress(hDLL, 'glutStrokeLength');
  @glutWireSphere := GetProcAddress(hDLL, 'glutWireSphere');
  @glutSolidSphere := GetProcAddress(hDLL, 'glutSolidSphere');
  @glutWireCone := GetProcAddress(hDLL, 'glutWireCone');
  @glutSolidCone := GetProcAddress(hDLL, 'glutSolidCone');
  @glutWireCube := GetProcAddress(hDLL, 'glutWireCube');
  @glutSolidCube := GetProcAddress(hDLL, 'glutSolidCube');
  @glutWireTorus := GetProcAddress(hDLL, 'glutWireTorus');
  @glutSolidTorus := GetProcAddress(hDLL, 'glutSolidTorus');
  @glutWireDodecahedron := GetProcAddress(hDLL, 'glutWireDodecahedron');
  @glutSolidDodecahedron := GetProcAddress(hDLL, 'glutSolidDodecahedron');
  @glutWireTeapot := GetProcAddress(hDLL, 'glutWireTeapot');
  @glutSolidTeapot := GetProcAddress(hDLL, 'glutSolidTeapot');
  @glutWireOctahedron := GetProcAddress(hDLL, 'glutWireOctahedron');
  @glutSolidOctahedron := GetProcAddress(hDLL, 'glutSolidOctahedron');
  @glutWireTetrahedron := GetProcAddress(hDLL, 'glutWireTetrahedron');
  @glutSolidTetrahedron := GetProcAddress(hDLL, 'glutSolidTetrahedron');
  @glutWireIcosahedron := GetProcAddress(hDLL, 'glutWireIcosahedron');
  @glutSolidIcosahedron := GetProcAddress(hDLL, 'glutSolidIcosahedron');
  @glutVideoResizeGet := GetProcAddress(hDLL, 'glutVideoResizeGet');
  @glutSetupVideoResizing := GetProcAddress(hDLL, 'glutSetupVideoResizing');
  @glutStopVideoResizing := GetProcAddress(hDLL, 'glutStopVideoResizing');
  @glutVideoResize := GetProcAddress(hDLL, 'glutVideoResize');
  @glutVideoPan := GetProcAddress(hDLL, 'glutVideoPan');
  @glutReportErrors := GetProcAddress(hDLL, 'glutReportErrors');

end;

initialization

  try
    LoadGlut('glut32.dll');
  except end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -