Advertisement
uaa

[wip:20170825] GLclock for OpenBSD

uaa
Aug 25th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.83 KB | None | 0 0
  1. diff -upr glclock-6.0b6.0.orig/GLObject.H glclock-6.0b6.0/GLObject.H
  2. --- glclock-6.0b6.0.orig/GLObject.H Thu Jun 22 23:36:07 2000
  3. +++ glclock-6.0b6.0/GLObject.H Fri Aug 25 17:16:46 2017
  4. @@ -11,7 +11,7 @@
  5. #pragma warning(disable : 4051) // ALPHA
  6. #endif
  7.  
  8. -#include <iostream.h>
  9. +#include <iostream>
  10.  
  11. #include "GLextensions.H"
  12. #include "PnmIO.H"
  13. @@ -269,7 +269,7 @@ class Vector3d (public)
  14. static const Vector3d white ;
  15. } ;
  16.  
  17. -ostream& operator <<(ostream& os, Vector3d& vec) ;
  18. +std::ostream& operator <<(std::ostream& os, Vector3d& vec) ;
  19.  
  20. inline GLfloat* VectorToArray(GLfloat v[3], const Vector3d& vec)
  21. {
  22. diff -upr glclock-6.0b6.0.orig/GLObject.cpp glclock-6.0b6.0/GLObject.cpp
  23. --- glclock-6.0b6.0.orig/GLObject.cpp Sun Jun 18 23:25:39 2000
  24. +++ glclock-6.0b6.0/GLObject.cpp Fri Aug 25 18:32:54 2017
  25. @@ -1371,7 +1371,7 @@ Vector3d ChangeSaturation(Vector3d src, float vividnes
  26. }
  27.  
  28.  
  29. -ostream& operator <<(ostream& os, const Vector3d& vec)
  30. +std::ostream& operator <<(std::ostream& os, const Vector3d& vec)
  31. {
  32. os << vec.X() << ", " << vec.Y() << ", " << vec.Z() ;
  33. return os ;
  34. diff -upr glclock-6.0b6.0.orig/GLextensions.H glclock-6.0b6.0/GLextensions.H
  35. --- glclock-6.0b6.0.orig/GLextensions.H Thu Jun 22 23:36:07 2000
  36. +++ glclock-6.0b6.0/GLextensions.H Fri Aug 25 18:34:48 2017
  37. @@ -202,7 +202,7 @@ float GetOpenGLVersion() ;
  38.  
  39.  
  40. // multitexture をサポートするバージョン(未定)
  41. -#ifdef GL_VERSION_1_
  42. +#ifdef GL_VERSION_1_3
  43. #define GL_VERSION_multitexture
  44. #endif
  45. #define GL_VERSION_multitexture_F 9999.9f
  46. @@ -214,7 +214,7 @@ float GetOpenGLVersion() ;
  47. #define GL_VERSION_separate_specular_color_F 1.2f
  48.  
  49. // texture_filter_anisotropic をサポートするバージョン(未定)
  50. -#ifdef GL_VERSION_1_
  51. +#ifdef GL_VERSION_1_2
  52. #define GL_VERSION_texture_filter_anisotropic
  53. #endif
  54. #define GL_VERSION_texture_filter_anisotropic_F 9999.9f
  55. @@ -232,25 +232,25 @@ float GetOpenGLVersion() ;
  56. #define GL_VERSION_polygon_offset_F 1.1f
  57.  
  58. // texture_cube_map をサポートするバージョン(未定)
  59. -#ifdef GL_VERSION_1_
  60. +#ifdef GL_VERSION_1_3
  61. #define GL_VERSION_texture_cube_map
  62. #endif
  63. #define GL_VERSION_texture_cube_map_F 9999.9f
  64.  
  65. // texture_compression をサポートするバージョン(未定)
  66. -#ifdef GL_VERSION_1_
  67. +#ifdef GL_VERSION_1_3
  68. #define GL_VERSION_texture_compression
  69. #endif
  70. #define GL_VERSION_texture_compression_F 9999.9f
  71.  
  72. // texture_compression_s3tc をサポートするバージョン(サポートされる訳ない?)
  73. -#ifdef GL_VERSION_1_
  74. +#ifdef GL_VERSION_1_3
  75. #define GL_VERSION_texture_compression_s3tc
  76. #endif
  77. #define GL_VERSION_texture_compression_s3tc_F 9999.9f
  78.  
  79. // texture_compression_FXT1 をサポートするバージョン(サポートされる訳ない?)
  80. -#ifdef GL_VERSION_1_
  81. +#ifdef GL_VERSION_1_3
  82. #define GL_VERSION_texture_compression_FXT1
  83. #endif
  84. #define GL_VERSION_texture_compression_FXT1_F 9999.9f
  85. diff -upr glclock-6.0b6.0.orig/GLextensions.cpp glclock-6.0b6.0/GLextensions.cpp
  86. --- glclock-6.0b6.0.orig/GLextensions.cpp Sun Jun 18 23:25:12 2000
  87. +++ glclock-6.0b6.0/GLextensions.cpp Fri Aug 25 18:46:33 2017
  88. @@ -640,7 +640,7 @@ GLfloat GetMaxTextureMaxAnisotropy()
  89.  
  90. GLfloat maxTextureMaxAnisotropy ;
  91. GLenum errCode = glGetError() ;
  92. - glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &maxTextureMaxAnisotropy) ; // maximum degree of anisotropy
  93. + glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxTextureMaxAnisotropy) ; // maximum degree of anisotropy
  94.  
  95. // for fixing nVIDIA old driver's anisotropic filtering error...
  96. // ignore "Invalid Enum" Error
  97. @@ -1026,10 +1026,10 @@ int IsSupported_EXT_texture_object()
  98. return FALSE ;
  99. #endif // #if defined(WIN32) && !defined(MESA)
  100.  
  101. - p_glGenTextures = glGenTexturesEXT ;
  102. - p_glDeleteTextures = glDeleteTexturesEXT ;
  103. - p_glBindTexture = glBindTextureEXT ;
  104. - p_glIsTexture = glIsTextureEXT ;
  105. + p_glGenTextures = glGenTextures ;
  106. + p_glDeleteTextures = glDeleteTextures ;
  107. + p_glBindTexture = glBindTexture ;
  108. + p_glIsTexture = glIsTexture ;
  109.  
  110. current_TextureObjectInterfaceName = CURRENT_NAME_GL_EXT_texture_object ;
  111. current_TextureObjectInterfaceNameString = current_TextureObjectInterfaceName ;
  112. @@ -1108,7 +1108,7 @@ int IsSupported_EXT_polygon_offset()
  113. return FALSE ;
  114. #endif // #if defined(WIN32) && !defined(MESA)
  115.  
  116. - p_glPolygonOffset = glPolygonOffsetEXT ;
  117. + p_glPolygonOffset = glPolygonOffset ;
  118.  
  119. DEF_GL_POLYGON_OFFSET_POINT = GL_POLYGON_OFFSET_EXT ; // EXT_polygon_offset では、すべて共通(有効なのは FILL のみ?)
  120. DEF_GL_POLYGON_OFFSET_LINE = GL_POLYGON_OFFSET_EXT ;
  121. @@ -1446,10 +1446,10 @@ GLint InternalFormat(String str)
  122. // Is texture_compression_s3tc available
  123. if (current_TextureCompressionS3TCInterfaceName)
  124. {
  125. - if (str / "GL_COMPRESSED_RGB_S3TC_DXT1") format = GL_COMPRESSED_RGB_S3TC_DXT1 ;
  126. - else if (str / "GL_COMPRESSED_RGBA_S3TC_DXT1") format = GL_COMPRESSED_RGBA_S3TC_DXT1 ;
  127. - else if (str / "GL_COMPRESSED_RGBA_S3TC_DXT3") format = GL_COMPRESSED_RGBA_S3TC_DXT3 ;
  128. - else if (str / "GL_COMPRESSED_RGBA_S3TC_DXT5") format = GL_COMPRESSED_RGBA_S3TC_DXT5 ;
  129. + if (str / "GL_COMPRESSED_RGB_S3TC_DXT1") format = GL_COMPRESSED_RGB_S3TC_DXT1_EXT ;
  130. + else if (str / "GL_COMPRESSED_RGBA_S3TC_DXT1") format = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ;
  131. + else if (str / "GL_COMPRESSED_RGBA_S3TC_DXT3") format = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ;
  132. + else if (str / "GL_COMPRESSED_RGBA_S3TC_DXT5") format = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT ;
  133. }
  134. else
  135. {
  136. @@ -1463,8 +1463,8 @@ GLint InternalFormat(String str)
  137. // Is texture_compression_FXT1 available
  138. if (current_TextureCompressionFXT1InterfaceName)
  139. {
  140. - if (str / "GL_COMPRESSED_RGB_FXT1") format = GL_COMPRESSED_RGB_FXT1 ;
  141. - else if (str / "GL_COMPRESSED_RGBA_FXT1") format = GL_COMPRESSED_RGBA_FXT1 ;
  142. + if (str / "GL_COMPRESSED_RGB_FXT1") format = GL_COMPRESSED_RGB_FXT1_3DFX ;
  143. + else if (str / "GL_COMPRESSED_RGBA_FXT1") format = GL_COMPRESSED_RGBA_FXT1_3DFX ;
  144. }
  145. else
  146. {
  147. @@ -1646,14 +1646,14 @@ String InternalFormatString(GLint internalFormat)
  148. case GL_COMPRESSED_RGBA: str = "GL_COMPRESSED_RGBA" ; break ;
  149.  
  150. // s3tc format
  151. - case GL_COMPRESSED_RGB_S3TC_DXT1: str = "GL_COMPRESSED_RGB_S3TC_DXT1" ; break ;
  152. - case GL_COMPRESSED_RGBA_S3TC_DXT1: str = "GL_COMPRESSED_RGBA_S3TC_DXT1" ; break ;
  153. - case GL_COMPRESSED_RGBA_S3TC_DXT3: str = "GL_COMPRESSED_RGBA_S3TC_DXT3" ; break ;
  154. - case GL_COMPRESSED_RGBA_S3TC_DXT5: str = "GL_COMPRESSED_RGBA_S3TC_DXT5" ; break ;
  155. + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: str = "GL_COMPRESSED_RGB_S3TC_DXT1" ; break ;
  156. + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: str = "GL_COMPRESSED_RGBA_S3TC_DXT1" ; break ;
  157. + case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: str = "GL_COMPRESSED_RGBA_S3TC_DXT3" ; break ;
  158. + case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: str = "GL_COMPRESSED_RGBA_S3TC_DXT5" ; break ;
  159.  
  160. // FXT1 format
  161. - case GL_COMPRESSED_RGB_FXT1: str = "GL_COMPRESSED_RGB_FXT1" ; break ;
  162. - case GL_COMPRESSED_RGBA_FXT1: str = "GL_COMPRESSED_RGBA_FXT1" ; break ;
  163. + case GL_COMPRESSED_RGB_FXT1_3DFX: str = "GL_COMPRESSED_RGB_FXT1" ; break ;
  164. + case GL_COMPRESSED_RGBA_FXT1_3DFX: str = "GL_COMPRESSED_RGBA_FXT1" ; break ;
  165.  
  166. default:
  167. str = "Unknown format" ; break ;
  168. diff -upr glclock-6.0b6.0.orig/MString.H glclock-6.0b6.0/MString.H
  169. --- glclock-6.0b6.0.orig/MString.H Thu Jun 22 23:58:26 2000
  170. +++ glclock-6.0b6.0/MString.H Fri Aug 25 18:50:16 2017
  171. @@ -66,7 +66,7 @@
  172. #ifndef ___STRING_H___
  173. #define ___STRING_H___
  174.  
  175. -#include <iostream.h>
  176. +#include <iostream>
  177. #include <stdio.h>
  178. #include <stdlib.h>
  179. #include <string.h>
  180. @@ -396,8 +396,8 @@ class String
  181. String& operator *=(int n) ;
  182.  
  183. // 入出力オペレータ
  184. - friend ostream& operator <<(ostream& os, const String& s) ;
  185. - friend istream& operator >>(istream& is, String& s) ;
  186. + friend std::ostream& operator <<(std::ostream& os, const String& s) ;
  187. + friend std::istream& operator >>(std::istream& is, String& s) ;
  188.  
  189.  
  190. // 拡張
  191. diff -upr glclock-6.0b6.0.orig/MString.cpp glclock-6.0b6.0/MString.cpp
  192. --- glclock-6.0b6.0.orig/MString.cpp Thu Jun 22 23:58:41 2000
  193. +++ glclock-6.0b6.0/MString.cpp Fri Aug 25 18:54:39 2017
  194. @@ -1,6 +1,9 @@
  195.  
  196. #include "MString.H"
  197.  
  198. +String Left(const String &, int);
  199. +String Mid(String, int, int);
  200. +String Right(const String &, int);
  201.  
  202. // コンストラクタ
  203. String::String(int n)
  204. @@ -1060,12 +1063,12 @@ String& String::operator *=(int n)
  205. }
  206.  
  207. // 入出力オペレータ
  208. -ostream& operator <<(ostream& os, const String& s)
  209. +std::ostream& operator <<(std::ostream& os, const String& s)
  210. {
  211. os << s.str ;
  212. return os ;
  213. }
  214. -istream& operator >>(istream& is, String& s)
  215. +std::istream& operator >>(std::istream& is, String& s)
  216. {
  217. is >> s.str ;
  218. return is ;
  219. diff -upr glclock-6.0b6.0.orig/glclock.cpp glclock-6.0b6.0/glclock.cpp
  220. --- glclock-6.0b6.0.orig/glclock.cpp Mon Jun 26 02:39:00 2000
  221. +++ glclock-6.0b6.0/glclock.cpp Fri Aug 25 18:35:28 2017
  222. @@ -844,7 +844,7 @@ void UpdateOpenGLAnisotropy(float anisotropy = -1.0f)
  223. anisotropy = 1.0f ;
  224.  
  225. // 可能であれば、Anisotropic Filtering を有効に
  226. - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY, anisotropy) ;
  227. + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, anisotropy) ;
  228. }
  229.  
  230.  
  231. diff -upr glclock-6.0b6.0.orig/makefile glclock-6.0b6.0/makefile
  232. --- glclock-6.0b6.0.orig/makefile Sun Jun 18 23:37:40 2000
  233. +++ glclock-6.0b6.0/makefile Fri Aug 25 16:37:36 2017
  234. @@ -15,8 +15,8 @@
  235. LINKER = g++
  236. OPT = -O2
  237.  
  238. - INCLUDE_PATH = -I/usr/X11R6/include
  239. - LIB_PATH = -L/usr/X11R6/lib
  240. + INCLUDE_PATH = -I/usr/X11R6/include -I/usr/local/include
  241. + LIB_PATH = -L/usr/X11R6/lib -L/usr/local/lib
  242.  
  243. LIBS = -lglut -lGLU -lGL -lXi -lXmu -lXext -lX11 -lm
  244. MARK_LIBS = -lm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement