Ooops
October 28, 2021, 11:14:31

Author Topic: [bb] sGLU32.dll by JoshK [ 1+ years ago ]  (Read 1707 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] sGLU32.dll by JoshK [ 1+ years ago ]
« on: June 29, 2017, 00:28:38 »
Title : sGLU32.dll
Author : JoshK
Posted : 1+ years ago

Description : DLL source is PureBasic.  This requires the glwrapper and F64 libraries, available from PureArea.net.

Code :
Code: BlitzBasic
  1. sGLU32.decls:
  2. .lib "dllssGlu32.dll"
  3. gluOrtho2D(nleft#,nright#,nbottom#,ntop#)
  4. gluPerspective(fovy#,aspect#,zNear#,zFar#)
  5. gluPickMatrix(x#,y#,nwidth#,nheight#,pviewport*)
  6. gluSphere(qobj,radius#,slices,stacks)
  7. glOrtho(nleft#,nright#,bottom#,top#,zNear#,zFar#)
  8. gluProject(objx#,objy#,objz#,modelmatrix*,projmatrix*,viewport*,winx#,winy#,winz#)
  9. gluUnProject%(winx#,winy#,winz#,modelmatrix*,projmatrix*,viewport*,objx*,objy*,objz*)
  10. gluLookAt(eyex#,eyey#,eyez#,centerx#,centery#,centerz#,upx#,upy#,upz#)
  11. gluCylinder(qobj,baseRadius#,topRadius#,nheight#,slices,stacks)
  12. gluDisk(qobj,innerRadius#,outerRadius#,slices,loops)
  13. gluPartialDisk(qobj,innerRadius#,outerRadius#,slices,loops,startAngle#,sweepAngle#)
  14.  
  15. sGLU32.dll:
  16. Structure double
  17. a.l
  18. b.l
  19. EndStructure
  20.  
  21. ProcedureDLL gluOrtho2D(nleft.f,nright.f,nbottom.f,ntop.f)
  22. gluOrtho2D__(nleft.f,nright.f,nbottom.f,ntop.f)
  23. EndProcedure
  24.  
  25. ProcedureDLL gluPerspective(fovy.f,aspect.f,zNear.f,zFar.f)
  26. gluPerspective__(fovy.f,aspect.f,zNear.f,zFar.f)
  27. EndProcedure
  28.  
  29. ProcedureDLL gluPickMatrix(x.f,y.f,nwidth.f,nheight.f,pviewport)
  30. gluPickMatrix__(x.f,y.f,nwidth.f,nheight.f,pviewport)
  31. EndProcedure
  32.  
  33. ProcedureDLL gluSphere(qobj,radius.f,slices,stacks)
  34. gluSphere__(qobj,radius.f,slices,stacks)
  35. EndProcedure
  36.  
  37. ProcedureDLL glOrtho(nleft.f,nright.f,bottom.f,top.f,zNear.f,zFar.f)
  38. glOrtho__(nleft.f,nright.f,bottom.f,top.f,zNear.f,zFar.f)
  39. EndProcedure
  40.  
  41. ProcedureDLL gluLookAt(eyex.f,eyey.f,eyez.f,centerx.f,centery.f,centerz.f,upx.f,upy.f,upz.f)
  42. gluLookAt__(eyex.f,eyey.f,eyez.f,centerx.f,centery.f,centerz.f,upx.f,upy.f,upz.f)
  43. EndProcedure
  44.  
  45. ProcedureDLL gluProject(objx.f,objy.f,objz.f,modelmatrix,projmatrix,viewport,winx.f,winy.f,winz.f)
  46. gluProject__(objx.f,objy.f,objz.f,modelmatrix,projmatrix,viewport,winx.f,winy.f,winz.f)
  47. EndProcedure
  48.  
  49. ProcedureDLL gluCylinder(qobj,baseRadius.f,topRadius.f,nheight.f,slices,stacks)            
  50. gluCylinder__(qobj,baseRadius.f,topRadius.f,nheight.f,slices,stacks)
  51. EndProcedure
  52.  
  53. ProcedureDLL gluDisk(qobj,innerRadius.f,outerRadius.f,slices,loops)
  54. gluDisk__(qobj,innerRadius.f,outerRadius.f,slices,loops)
  55. EndProcedure
  56.  
  57. ProcedureDLL gluPartialDisk(qobj,innerRadius.f,outerRadius.f,slices,loops,startAngle.f,sweepAngle.f)
  58. gluPartialDisk__(qobj,innerRadius.f,outerRadius.f,slices,loops,startAngle.f,sweepAngle.f)
  59. EndProcedure
  60.  
  61. ;ProcedureDLL.l gluUnProject(winx.f,winy.f,winz.f,modelmatrix,projmatrix,viewport,objx,objy,objz)
  62. ;ProcedureReturn gluUnProject__(winx.f,winy.f,winz.f,modelmatrix,projmatrix,viewport,objx,objy,objz)
  63. ;EndProcedure
  64.  
  65. ProcedureDLL.l gluUnProject(winx.f,winy.f,winz.f,modelmatrix,projmatrix,viewport,objx,objy,objz)
  66. dwinx.double
  67. dwiny.double
  68. dwinz.double
  69. F64_Float(dwinx.double,winx)
  70. F64_Float(dwiny.double,winy)
  71. F64_Float(dwinz.double,winz)
  72. dobjx=AllocateMemory(8)
  73. dobjy=AllocateMemory(8)
  74. dobjz=AllocateMemory(8)
  75. result=gluUnProject_(dwinxa,dwinx,dwinya,dwiny,dwinza,dwinz,modelmatrix,projmatrix,viewport,dobjx,dobjy,dobjz)
  76. x.double
  77. y.double
  78. z.double
  79. xa=PeekL(dobjx+0)
  80. x=PeekL(dobjx+4)
  81. ya=PeekL(dobjy+0)
  82. y=PeekL(dobjy+4)
  83. za=PeekL(dobjz+0)
  84. z=PeekL(dobjz+4)
  85. rx.f=F64_toFloat(x)
  86. ry.f=F64_toFloat(y)
  87. rz.f=F64_toFloat(z)
  88. PokeF(objx,rx)
  89. PokeF(objy,ry)
  90. PokeF(objz,rz)
  91. FreeMemory(dobjx)
  92. FreeMemory(dobjy)
  93. FreeMemory(dobjz)
  94. ProcedureReturn result
  95. EndProcedure


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal