OGLplus (0.52.0) a C++ wrapper for OpenGL

texture.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_DSA_TEXTURE_1107121519_HPP
14 #define OGLPLUS_DSA_TEXTURE_1107121519_HPP
15 
16 #include <oglplus/texture.hpp>
17 
18 namespace oglplus {
19 
20 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_5 || GL_ARB_direct_state_access
21 
22 template <>
23 struct ObjGenTag<tag::DirectState, tag::Texture>
24 {
25  typedef tag::Create Type;
26 };
27 
29 
32 template <>
33 class ObjZeroOps<tag::DirectState, tag::Texture>
34  : public ObjCommonOps<tag::Texture>
35 {
36 protected:
37  ObjZeroOps(void) { }
38 };
39 
41 
44 template <>
45 class ObjectOps<tag::DirectState, tag::Texture>
46  : public ObjZeroOps<tag::DirectState, tag::Texture>
47 {
48 protected:
49  ObjectOps(void) { }
50 public:
52  struct Property
53  {
56 
59 
62 
65 
68 
71 
72 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_0
75 #endif
76 
79 
81  typedef TextureWrap Wrap;
82 
84  typedef OneOf<
85  GLenum,
86  std::tuple<
87  DataType,
89  >
91  };
92 
94 
95  GLint GetIntParam(GLenum query) const;
96  GLfloat GetFloatParam(GLenum query) const;
97 
98  GLint GetIntParam(GLint level, GLenum query) const;
99  GLfloat GetFloatParam(GLint level, GLenum query) const;
100 
102 
110  GLsizei Width(GLint level = 0) const
111  {
112  return GLsizei(GetIntParam(level, GL_TEXTURE_WIDTH));
113  }
114 
116 
124  GLsizei Height(GLint level = 0) const
125  {
126  return GLsizei(GetIntParam(level, GL_TEXTURE_HEIGHT));
127  }
128 
130 
138  GLsizei Depth(GLint level = 0) const
139  {
140  return GLsizei(GetIntParam(level, GL_TEXTURE_DEPTH));
141  }
142 
144 
154  PixelDataType RedType(GLint level = 0) const
155  {
156  return PixelDataType(GetIntParam(
157  level,
158  GL_TEXTURE_RED_TYPE
159  ));
160  }
161 
163 
173  PixelDataType GreenType(GLint level = 0) const
174  {
175  return PixelDataType(GetIntParam(
176  level,
177  GL_TEXTURE_GREEN_TYPE
178  ));
179  }
180 
182 
192  PixelDataType BlueType(GLint level = 0) const
193  {
194  return PixelDataType(GetIntParam(
195  level,
196  GL_TEXTURE_BLUE_TYPE
197  ));
198  }
199 
201 
211  PixelDataType AlphaType(GLint level = 0) const
212  {
213  return PixelDataType(GetIntParam(
214  level,
215  GL_TEXTURE_ALPHA_TYPE
216  ));
217  }
218 
220 
230  PixelDataType DepthType(GLint level = 0) const
231  {
232  return PixelDataType(GetIntParam(
233  level,
234  GL_TEXTURE_DEPTH_TYPE
235  ));
236  }
237 
239 
250  GLsizei RedSize(GLint level = 0) const
251  {
252  return GLsizei(GetIntParam(
253  level,
254  GL_TEXTURE_RED_SIZE
255  ));
256  }
257 
259 
270  GLsizei GreenSize(GLint level = 0) const
271  {
272  return GLsizei(GetIntParam(
273  level,
274  GL_TEXTURE_GREEN_SIZE
275  ));
276  }
277 
279 
290  GLsizei BlueSize(GLint level = 0) const
291  {
292  return GLsizei(GetIntParam(
293  level,
294  GL_TEXTURE_BLUE_SIZE
295  ));
296  }
297 
299 
310  GLsizei AlphaSize(GLint level = 0) const
311  {
312  return GLsizei(GetIntParam(
313  level,
314  GL_TEXTURE_ALPHA_SIZE
315  ));
316  }
317 
319 
330  GLsizei DepthSize(GLint level = 0) const
331  {
332  return GLsizei(GetIntParam(
333  level,
334  GL_TEXTURE_DEPTH_SIZE
335  ));
336  }
337 
339 
350  GLsizei StencilSize(GLint level = 0) const
351  {
352  return GLsizei(GetIntParam(
353  level,
354  GL_TEXTURE_STENCIL_SIZE
355  ));
356  }
357 
359 
371  GLsizei SharedSize(GLint level = 0) const
372  {
373  return GLsizei(GetIntParam(
374  level,
375  GL_TEXTURE_SHARED_SIZE
376  ));
377  }
378 
380 
385  GLsizei CompressedImageSize(GLint level = 0) const
386  {
387  return GLsizei(GetIntParam(
388  level,
389  GL_TEXTURE_COMPRESSED_IMAGE_SIZE
390  ));
391  }
392 
394 
400  {
401  return PixelDataInternalFormat(GetIntParam(
402  level,
403  GL_TEXTURE_INTERNAL_FORMAT
404  ));
405  }
406 
408 
422  void GetImage(
423  GLint level,
424  PixelDataFormat format,
425  const OutputData& dest
426  ) const;
427 
429 
443  void GetImage(
444  GLint level,
445  PixelDataFormat format,
447  GLsizei size,
448  GLvoid* buffer
449  ) const
450  {
451  GetImage(level, format, OutputData(type, size, buffer));
452  }
453 
454  void GetCompressedImage(
455  GLint level,
456  const OutputData& dest
457  ) const;
458 
460 
470  GLint level,
471  GLsizei size,
472  GLubyte* buffer
473  ) const
474  {
475  GetCompressedImage(level, OutputData(size, buffer));
476  }
477 
479 
488  void GetCompressedImage(
489  GLint level,
490  std::vector<GLubyte>& dest
491  ) const;
492 
494 
499  GLsizei levels,
500  PixelDataInternalFormat internal_format,
501  GLsizei width
502  )
503  {
504  OGLPLUS_GLFUNC(TextureStorage1D)(
505  _name,
506  levels,
507  GLenum(internal_format),
508  width
509  );
510  OGLPLUS_CHECK(
511  TextureStorage1D,
512  ObjectError,
513  Object(*this).
514  EnumParam(internal_format)
515  );
516  return *this;
517  }
518 
519  ObjectOps& Storage1D(
520  GLsizei levels,
521  const images::ImageSpec& image_spec
522  );
523 
525 
530  GLsizei levels,
531  PixelDataInternalFormat internal_format,
532  GLsizei width,
533  GLsizei height
534  )
535  {
536  OGLPLUS_GLFUNC(TextureStorage2D)(
537  _name,
538  levels,
539  GLenum(internal_format),
540  width,
541  height
542  );
543  OGLPLUS_CHECK(
544  TextureStorage2D,
545  ObjectError,
546  Object(*this).
547  EnumParam(internal_format)
548  );
549  return *this;
550  }
551 
552  ObjectOps& Storage2D(
553  GLsizei levels,
554  const images::ImageSpec& image_spec
555  );
556 
558 
563  GLsizei levels,
564  PixelDataInternalFormat internal_format,
565  GLsizei width,
566  GLsizei height,
567  GLsizei depth
568  )
569  {
570  OGLPLUS_GLFUNC(TextureStorage3D)(
571  _name,
572  levels,
573  GLenum(internal_format),
574  width,
575  height,
576  depth
577  );
578  OGLPLUS_CHECK(
579  TextureStorage3D,
580  ObjectError,
581  Object(*this).
582  EnumParam(internal_format)
583  );
584  return *this;
585  }
586 
587  ObjectOps& Storage3D(
588  GLsizei levels,
589  const images::ImageSpec& image_spec
590  );
591 
592  ObjectOps& Storage(
593  GLsizei levels,
594  const images::ImageSpec& image_spec
595  );
596 
598 
603  GLint level,
604  GLint xoffs,
605  GLint yoffs,
606  GLint zoffs,
607  GLsizei width,
608  GLsizei height,
609  GLsizei depth,
610  PixelDataFormat format,
612  const void* data
613  )
614  {
615  OGLPLUS_GLFUNC(TextureSubImage3D)(
616  _name,
617  level,
618  xoffs,
619  yoffs,
620  zoffs,
621  width,
622  height,
623  depth,
624  GLenum(format),
625  GLenum(type),
626  data
627  );
628  OGLPLUS_CHECK(
629  TextureSubImage3D,
630  ObjectError,
631  Object(*this).
632  EnumParam(format).
633  Index(level)
634  );
635  return *this;
636  }
637 
639 
643  ObjectOps& SubImage3D(
644  const images::Image& image,
645  GLint xoffs = 0,
646  GLint yoffs = 0,
647  GLint zoffs = 0,
648  GLint level = 0
649  );
650 
652 
657  GLint level,
658  GLint xoffs,
659  GLint yoffs,
660  GLsizei width,
661  GLsizei height,
662  PixelDataFormat format,
664  const void* data
665  )
666  {
667  OGLPLUS_GLFUNC(TextureSubImage2D)(
668  _name,
669  level,
670  xoffs,
671  yoffs,
672  width,
673  height,
674  GLenum(format),
675  GLenum(type),
676  data
677  );
678  OGLPLUS_CHECK(
679  TextureSubImage2D,
680  ObjectError,
681  Object(*this).
682  EnumParam(format).
683  Index(level)
684  );
685  return *this;
686  }
687 
689 
693  ObjectOps& SubImage2D(
694  const images::Image& image,
695  GLint xoffs = 0,
696  GLint yoffs = 0,
697  GLint level = 0
698  );
699 
701 
706  GLint level,
707  GLint xoffs,
708  GLsizei width,
709  PixelDataFormat format,
711  const void* data
712  )
713  {
714  OGLPLUS_GLFUNC(TextureSubImage1D)(
715  _name,
716  level,
717  xoffs,
718  width,
719  GLenum(format),
720  GLenum(type),
721  data
722  );
723  OGLPLUS_CHECK(
724  TextureSubImage1D,
725  ObjectError,
726  Object(*this).
727  EnumParam(format).
728  Index(level)
729  );
730  return *this;
731  }
732 
734 
738  ObjectOps& SubImage1D(
739  const images::Image& image,
740  GLint xoffs = 0,
741  GLint level = 0
742  );
743 
745 
750  GLint level,
751  GLint xoffs,
752  GLint yoffs,
753  GLint zoffs,
754  GLint x,
755  GLint y,
756  GLsizei width,
757  GLsizei height
758  )
759  {
760  OGLPLUS_GLFUNC(CopyTextureSubImage3D)(
761  _name,
762  level,
763  xoffs,
764  yoffs,
765  zoffs,
766  x,
767  y,
768  width,
769  height
770  );
771  OGLPLUS_CHECK(
772  CopyTextureSubImage3D,
773  ObjectError,
774  Object(*this).
775  Index(level)
776  );
777  return *this;
778  }
779 
781 
786  GLint level,
787  GLint xoffs,
788  GLint yoffs,
789  GLint x,
790  GLint y,
791  GLsizei width,
792  GLsizei height
793  )
794  {
795  OGLPLUS_GLFUNC(CopyTextureSubImage2D)(
796  _name,
797  level,
798  xoffs,
799  yoffs,
800  x,
801  y,
802  width,
803  height
804  );
805  OGLPLUS_CHECK(
806  CopyTextureSubImage2D,
807  ObjectError,
808  Object(*this).
809  Index(level)
810  );
811  return *this;
812  }
813 
815 
820  GLint level,
821  GLint xoffs,
822  GLint x,
823  GLint y,
824  GLsizei width
825  )
826  {
827  OGLPLUS_GLFUNC(CopyTextureSubImage1D)(
828  _name,
829  level,
830  xoffs,
831  x,
832  y,
833  width
834  );
835  OGLPLUS_CHECK(
836  CopyTextureSubImage1D,
837  ObjectError,
838  Object(*this).
839  Index(level)
840  );
841  return *this;
842  }
843 
845 
850  GLint level,
851  GLint xoffs,
852  GLint yoffs,
853  GLint zoffs,
854  GLsizei width,
855  GLsizei height,
856  GLsizei depth,
857  PixelDataFormat format,
858  GLsizei image_size,
859  const void* data
860  )
861  {
862  OGLPLUS_GLFUNC(CompressedTextureSubImage3D)(
863  _name,
864  level,
865  xoffs,
866  yoffs,
867  zoffs,
868  width,
869  height,
870  depth,
871  GLint(format),
872  image_size,
873  data
874  );
875  OGLPLUS_CHECK(
876  CompressedTextureSubImage3D,
877  ObjectError,
878  Object(*this).
879  EnumParam(format).
880  Index(level)
881  );
882  return *this;
883  }
884 
886 
891  GLint level,
892  GLint xoffs,
893  GLint yoffs,
894  GLsizei width,
895  GLsizei height,
896  PixelDataFormat format,
897  GLsizei image_size,
898  const void* data
899  )
900  {
901  OGLPLUS_GLFUNC(CompressedTextureSubImage2D)(
902  _name,
903  level,
904  xoffs,
905  yoffs,
906  width,
907  height,
908  GLint(format),
909  image_size,
910  data
911  );
912  OGLPLUS_CHECK(
913  CompressedTextureSubImage2D,
914  ObjectError,
915  Object(*this).
916  EnumParam(format).
917  Index(level)
918  );
919  return *this;
920  }
921 
923 
928  GLint level,
929  GLint xoffs,
930  GLsizei width,
931  PixelDataFormat format,
932  GLsizei image_size,
933  const void* data
934  )
935  {
936  OGLPLUS_GLFUNC(CompressedTextureSubImage1D)(
937  _name,
938  level,
939  xoffs,
940  width,
941  GLint(format),
942  image_size,
943  data
944  );
945  OGLPLUS_CHECK(
946  CompressedTextureSubImage1D,
947  ObjectError,
948  Object(*this).
949  EnumParam(format).
950  Index(level)
951  );
952  return *this;
953  }
954 
956 
962  PixelDataInternalFormat internal_format,
963  BufferName buffer
964  )
965  {
966  OGLPLUS_GLFUNC(TextureBuffer)(
967  _name,
968  GLenum(internal_format),
969  GetGLName(buffer)
970  );
971  OGLPLUS_CHECK(
972  TextureBuffer,
973  ObjectPairError,
974  Subject(buffer).
975  Object(*this).
976  EnumParam(internal_format)
977  );
978  return *this;
979  }
980 
982 
987  GLuint BaseLevel(void) const
988  {
989  return GetIntParam(GL_TEXTURE_BASE_LEVEL);
990  }
991 
993 
998  ObjectOps& BaseLevel(GLuint level)
999  {
1000  OGLPLUS_GLFUNC(TextureParameteri)(
1001  _name,
1002  GL_TEXTURE_BASE_LEVEL,
1003  level
1004  );
1005  OGLPLUS_CHECK(
1006  TextureParameteri,
1007  ObjectError,
1008  Object(*this).
1009  Index(level)
1010  );
1011  return *this;
1012  }
1013 
1015 
1021  {
1022  GLfloat result[4];
1023  OGLPLUS_GLFUNC(GetTextureParameterfv)(
1024  _name,
1025  GL_TEXTURE_BORDER_COLOR,
1026  result
1027  );
1028  OGLPLUS_CHECK(
1029  GetTextureParameterfv,
1030  ObjectError,
1031  Object(*this)
1032  );
1033  return Vector<GLfloat, 4>(result, 4);
1034  }
1035 
1037 
1043  {
1044  OGLPLUS_GLFUNC(TextureParameterfv)(
1045  _name,
1046  GL_TEXTURE_BORDER_COLOR,
1047  Data(color)
1048  );
1049  OGLPLUS_CHECK(
1050  TextureParameterfv,
1051  ObjectError,
1052  Object(*this)
1053  );
1054  return *this;
1055  }
1056 
1058 
1064  {
1065  GLint result[4];
1066  OGLPLUS_GLFUNC(GetTextureParameterIiv)(
1067  _name,
1068  GL_TEXTURE_BORDER_COLOR,
1069  result
1070  );
1071  OGLPLUS_CHECK(
1072  GetTextureParameterIiv,
1073  ObjectError,
1074  Object(*this)
1075  );
1076  return Vector<GLint, 4>(result, 4);
1077  }
1078 
1080 
1086  {
1087  OGLPLUS_GLFUNC(TextureParameterIiv)(
1088  _name,
1089  GL_TEXTURE_BORDER_COLOR,
1090  Data(color)
1091  );
1092  OGLPLUS_CHECK(
1093  TextureParameterIiv,
1094  ObjectError,
1095  Object(*this)
1096  );
1097  return *this;
1098  }
1099 
1101 
1107  {
1108  GLuint result[4];
1109  OGLPLUS_GLFUNC(GetTextureParameterIuiv)(
1110  _name,
1111  GL_TEXTURE_BORDER_COLOR,
1112  result
1113  );
1114  OGLPLUS_CHECK(
1115  GetTextureParameterIuiv,
1116  ObjectError,
1117  Object(*this)
1118  );
1119  return Vector<GLuint, 4>(result, 4);
1120  }
1121 
1123 
1129  {
1130  OGLPLUS_GLFUNC(TextureParameterIuiv)(
1131  _name,
1132  GL_TEXTURE_BORDER_COLOR,
1133  Data(color)
1134  );
1135  OGLPLUS_CHECK(
1136  TextureParameterIuiv,
1137  ObjectError,
1138  Object(*this)
1139  );
1140  return *this;
1141  }
1142 
1144 
1150  {
1151  return TextureCompareMode(GetIntParam(
1152  GL_TEXTURE_COMPARE_MODE
1153  ));
1154  }
1155 
1157 
1163  {
1164  OGLPLUS_GLFUNC(TextureParameteri)(
1165  _name,
1166  GL_TEXTURE_COMPARE_MODE,
1167  GLenum(mode)
1168  );
1169  OGLPLUS_CHECK(
1170  TextureParameteri,
1171  ObjectError,
1172  Object(*this).
1173  EnumParam(mode)
1174  );
1175  return *this;
1176  }
1177 
1179 
1185  {
1186  return CompareFunction(GetIntParam(
1187  GL_TEXTURE_COMPARE_FUNC
1188  ));
1189  }
1190 
1192 
1198  {
1199  OGLPLUS_GLFUNC(TextureParameteri)(
1200  _name,
1201  GL_TEXTURE_COMPARE_FUNC,
1202  GLenum(func)
1203  );
1204  OGLPLUS_CHECK(
1205  TextureParameteri,
1206  ObjectError,
1207  Object(*this).
1208  EnumParam(func)
1209  );
1210  return *this;
1211  }
1212 
1214 
1219  GLfloat LODBias(void) const
1220  {
1221  return GetFloatParam(GL_TEXTURE_LOD_BIAS);
1222  }
1223 
1225 
1230  ObjectOps& LODBias(GLfloat value)
1231  {
1232  OGLPLUS_GLFUNC(TextureParameterf)(
1233  _name,
1234  GL_TEXTURE_LOD_BIAS,
1235  value
1236  );
1237  OGLPLUS_CHECK(
1238  TextureParameterf,
1239  ObjectError,
1240  Object(*this)
1241  );
1242  return *this;
1243  }
1244 
1246 
1253  {
1254  OGLPLUS_GLFUNC(TextureParameteri)(
1255  _name,
1256  GL_TEXTURE_MIN_FILTER,
1257  GLenum(filter)
1258  );
1259  OGLPLUS_CHECK(
1260  TextureParameteri,
1261  ObjectError,
1262  Object(*this).
1263  EnumParam(filter)
1264  );
1265  OGLPLUS_GLFUNC(TextureParameteri)(
1266  _name,
1267  GL_TEXTURE_MAG_FILTER,
1268  GLenum(filter)
1269  );
1270  OGLPLUS_CHECK(
1271  TextureParameteri,
1272  ObjectError,
1273  Object(*this).
1274  EnumParam(filter)
1275  );
1276  return *this;
1277  }
1278 
1280 
1286  {
1287  return TextureMagFilter(GetIntParam(
1288  GL_TEXTURE_MAG_FILTER
1289  ));
1290  }
1291 
1293 
1299  {
1300  OGLPLUS_GLFUNC(TextureParameteri)(
1301  _name,
1302  GL_TEXTURE_MAG_FILTER,
1303  GLenum(filter)
1304  );
1305  OGLPLUS_CHECK(
1306  TextureParameteri,
1307  ObjectError,
1308  Object(*this).
1309  EnumParam(filter)
1310  );
1311  return *this;
1312  }
1313 
1315 
1321  {
1322  return TextureMinFilter(GetIntParam(
1323  GL_TEXTURE_MIN_FILTER
1324  ));
1325  }
1326 
1328 
1334  {
1335  OGLPLUS_GLFUNC(TextureParameteri)(
1336  _name,
1337  GL_TEXTURE_MIN_FILTER,
1338  GLenum(filter)
1339  );
1340  OGLPLUS_CHECK(
1341  TextureParameteri,
1342  ObjectError,
1343  Object(*this).
1344  EnumParam(filter)
1345  );
1346  return *this;
1347  }
1348 
1350 
1355  GLfloat MinLOD(void) const
1356  {
1357  return GetFloatParam(GL_TEXTURE_MIN_LOD);
1358  }
1359 
1361 
1366  ObjectOps& MinLOD(GLfloat value)
1367  {
1368  OGLPLUS_GLFUNC(TextureParameterf)(
1369  _name,
1370  GL_TEXTURE_MIN_LOD,
1371  value
1372  );
1373  OGLPLUS_CHECK(
1374  TextureParameterf,
1375  ObjectError,
1376  Object(*this)
1377  );
1378  return *this;
1379  }
1380 
1382 
1387  GLfloat MaxLOD(void) const
1388  {
1389  return GetFloatParam(GL_TEXTURE_MAX_LOD);
1390  }
1391 
1393 
1398  ObjectOps& MaxLOD(GLfloat value)
1399  {
1400  OGLPLUS_GLFUNC(TextureParameterf)(
1401  _name,
1402  GL_TEXTURE_MAX_LOD,
1403  value
1404  );
1405  OGLPLUS_CHECK(
1406  TextureParameterf,
1407  ObjectError,
1408  Object(*this)
1409  );
1410  return *this;
1411  }
1412 
1414 
1419  GLint MaxLevel(void) const
1420  {
1421  return GetIntParam(GL_TEXTURE_MAX_LEVEL);
1422  }
1423 
1425 
1430  ObjectOps& MaxLevel(GLint value)
1431  {
1432  OGLPLUS_GLFUNC(TextureParameteri)(
1433  _name,
1434  GL_TEXTURE_MAX_LEVEL,
1435  value
1436  );
1437  OGLPLUS_CHECK(
1438  TextureParameteri,
1439  ObjectError,
1440  Object(*this)
1441  );
1442  return *this;
1443  }
1444 
1446 
1451  GLfloat MaxAnisotropy(void) const
1452  {
1453 #ifdef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
1454  return GetFloatParam(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT);
1455 #else
1456  return GLfloat(1);
1457 #endif
1458  }
1459 
1461 
1466  GLfloat Anisotropy(void) const
1467  {
1468 #ifdef GL_TEXTURE_MAX_ANISOTROPY_EXT
1469  return GetFloatParam(GL_TEXTURE_MAX_ANISOTROPY_EXT);
1470 #else
1471  return GLfloat(1);
1472 #endif
1473  }
1474 
1476 
1481  ObjectOps& Anisotropy(GLfloat value)
1482  {
1483 #ifdef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
1484  OGLPLUS_GLFUNC(TextureParameterf)(
1485  _name,
1486  GL_TEXTURE_MAX_ANISOTROPY_EXT,
1487  value
1488  );
1489  OGLPLUS_CHECK(
1490  TextureParameterf,
1491  ObjectError,
1492  Object(*this)
1493  );
1494 #else
1495  OGLPLUS_FAKE_USE(value);
1496 #endif
1497  return *this;
1498  }
1499 
1500 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_3_3 || GL_ARB_texture_swizzle
1501 
1508  {
1509  return TextureSwizzle(GetIntParam(
1510  GLenum(coord)
1511  ));
1512  }
1513 
1515 
1521  TextureSwizzleCoord coord,
1522  TextureSwizzle mode
1523  )
1524  {
1525  OGLPLUS_GLFUNC(TextureParameteri)(
1526  _name,
1527  GLenum(coord),
1528  GLenum(mode)
1529  );
1530  OGLPLUS_CHECK(
1531  TextureParameteri,
1532  ObjectError,
1533  Object(*this).
1534  EnumParam(mode)
1535  );
1536  return *this;
1537  }
1538 
1540 
1547  {
1548  return Swizzle(TextureSwizzleCoord::R);
1549  }
1550 
1552 
1559  {
1560  return Swizzle(TextureSwizzleCoord::R, mode);
1561  }
1562 
1564 
1571  {
1572  return Swizzle(TextureSwizzleCoord::G);
1573  }
1574 
1576 
1583  {
1584  return Swizzle(TextureSwizzleCoord::G, mode);
1585  }
1586 
1588 
1595  {
1596  return Swizzle(TextureSwizzleCoord::B);
1597  }
1598 
1600 
1607  {
1608  return Swizzle(TextureSwizzleCoord::B, mode);
1609  }
1610 
1612 
1619  {
1620  return Swizzle(TextureSwizzleCoord::A);
1621  }
1622 
1624 
1631  {
1632  return Swizzle(TextureSwizzleCoord::A, mode);
1633  }
1634 
1636 
1643  {
1644  TextureSwizzleTuple result;
1645  OGLPLUS_GLFUNC(GetTextureParameteriv)(
1646  _name,
1647  GL_TEXTURE_SWIZZLE_RGBA,
1648  result.Values()
1649  );
1650  OGLPLUS_CHECK(
1651  GetTextureParameteriv,
1652  ObjectError,
1653  Object(*this)
1654  );
1655  return result;
1656  }
1657 
1659 
1666  {
1667  GLint m = GLint(GLenum(mode));
1668  GLint params[4] = {m, m, m, m};
1669  OGLPLUS_GLFUNC(TextureParameteriv)(
1670  _name,
1671  GL_TEXTURE_SWIZZLE_RGBA,
1672  params
1673  );
1674  OGLPLUS_CHECK(
1675  TextureParameteriv,
1676  ObjectError,
1677  Object(*this).
1678  EnumParam(mode)
1679  );
1680  return *this;
1681  }
1682 
1684 
1691  TextureSwizzle mode_r,
1692  TextureSwizzle mode_g,
1693  TextureSwizzle mode_b,
1694  TextureSwizzle mode_a
1695  )
1696  {
1697  GLint params[4] = {
1698  GLint(GLenum(mode_r)),
1699  GLint(GLenum(mode_g)),
1700  GLint(GLenum(mode_b)),
1701  GLint(GLenum(mode_a))
1702  };
1703  OGLPLUS_GLFUNC(TextureParameteriv)(
1704  _name,
1705  GL_TEXTURE_SWIZZLE_RGBA,
1706  params
1707  );
1708  OGLPLUS_CHECK(
1709  TextureParameteriv,
1710  ObjectError,
1711  Object(*this)
1712  );
1713  return *this;
1714  }
1715 
1717 
1724  {
1725  OGLPLUS_GLFUNC(TextureParameteriv)(
1726  _name,
1727  GL_TEXTURE_SWIZZLE_RGBA,
1728  modes.Values()
1729  );
1730  OGLPLUS_CHECK(
1731  TextureParameteriv,
1732  ObjectError,
1733  Object(*this)
1734  );
1735  return *this;
1736  }
1737 #endif // texture swizzle
1738 
1740 
1745  {
1746  return TextureWrap(GetIntParam(GLenum(coord)));
1747  }
1748 
1750 
1755  TextureWrapCoord coord,
1756  TextureWrap mode
1757  )
1758  {
1759  OGLPLUS_GLFUNC(TextureParameteri)(
1760  _name,
1761  GLenum(coord),
1762  GLenum(mode)
1763  );
1764  OGLPLUS_CHECK(
1765  TextureParameteri,
1766  ObjectError,
1767  Object(*this).
1768  EnumParam(mode)
1769  );
1770  return *this;
1771  }
1772 
1774 
1779  TextureWrap WrapS(void) const
1780  {
1781  return Wrap(TextureWrapCoord::S);
1782  }
1783 
1785 
1791  {
1792  return Wrap(TextureWrapCoord::S, mode);
1793  }
1794 
1796 
1801  TextureWrap WrapT(void) const
1802  {
1803  return Wrap(TextureWrapCoord::T);
1804  }
1805 
1807 
1813  {
1814  return Wrap(TextureWrapCoord::T, mode);
1815  }
1816 
1818 
1823  TextureWrap WrapR(void) const
1824  {
1825  return Wrap(TextureWrapCoord::R);
1826  }
1827 
1829 
1835  {
1836  return Wrap(TextureWrapCoord::R, mode);
1837  }
1838 
1839 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_3
1840 
1848  {
1849  return PixelDataFormat(GetIntParam(
1850  GL_DEPTH_STENCIL_TEXTURE_MODE
1851  ));
1852  }
1853 
1855 
1862  {
1863  OGLPLUS_GLFUNC(TextureParameteri)(
1864  _name,
1865  GL_DEPTH_STENCIL_TEXTURE_MODE,
1866  GLenum(mode)
1867  );
1868  OGLPLUS_CHECK(
1869  TextureParameteri,
1870  ObjectError,
1871  Object(*this).
1872  EnumParam(mode)
1873  );
1874  return *this;
1875  }
1876 #endif
1877 
1878 #if OGLPLUS_DOCUMENTATION_ONLY || GL_ARB_seamless_cubemap_per_texture
1879 
1885  bool Seamless(void) const
1886  {
1887  return GetIntParam(GL_TEXTURE_CUBE_MAP_SEAMLESS) == GL_TRUE;
1888  }
1889 
1891 
1896  ObjectOps& Seamless(bool enable)
1897  {
1898  OGLPLUS_GLFUNC(TextureParameteri)(
1899  _name,
1900  GL_TEXTURE_CUBE_MAP_SEAMLESS,
1901  enable?GL_TRUE:GL_FALSE
1902  );
1903  OGLPLUS_CHECK(
1904  TextureParameteri,
1905  ObjectError,
1906  Object(*this)
1907  );
1908  return *this;
1909  }
1910 #endif
1911 
1913 
1918  {
1919  OGLPLUS_GLFUNC(GenerateTextureMipmap)(_name);
1920  OGLPLUS_CHECK(
1921  GenerateTextureMipmap,
1922  ObjectError,
1923  Object(*this)
1924  );
1925  return *this;
1926  }
1927 
1928 };
1929 
1931 typedef ObjectOps<tag::DirectState, tag::Texture>
1933 
1934 // Helper class for syntax-sugar operators
1935 struct DSATextureOpsAndSlot
1936 {
1937  DSATextureOps& tex;
1938  GLint slot;
1939 
1940  DSATextureOpsAndSlot(DSATextureOps& t, GLint s)
1941  : tex(t)
1942  , slot(s)
1943  { }
1944 };
1945 
1946 // syntax sugar operators
1947 inline DSATextureOpsAndSlot operator | (
1948  DSATextureOps& tex,
1949  GLuint slot
1950 )
1951 {
1952  return DSATextureOpsAndSlot(tex, slot);
1953 }
1954 
1955 // Bind
1956 inline DSATextureOps& operator << (
1957  DSATextureOps& tex,
1958  TextureTarget target
1959 )
1960 {
1961  tex.Bind(target);
1962  return tex;
1963 }
1964 
1965 // Filter
1966 inline DSATextureOps& operator << (
1967  DSATextureOps& tex,
1968  TextureFilter filter
1969 )
1970 {
1971  tex.Filter(filter);
1972  return tex;
1973 }
1974 
1975 // MinFilter
1976 inline DSATextureOps& operator << (
1977  DSATextureOps& tex,
1978  TextureMinFilter filter
1979 )
1980 {
1981  tex.MinFilter(filter);
1982  return tex;
1983 }
1984 
1985 // MagFilter
1986 inline DSATextureOps& operator << (
1987  DSATextureOps& tex,
1988  TextureMagFilter filter
1989 )
1990 {
1991  tex.MagFilter(filter);
1992  return tex;
1993 }
1994 
1995 // CompareMode
1996 inline DSATextureOps& operator << (
1997  DSATextureOps& tex,
1998  TextureCompareMode mode
1999 )
2000 {
2001  tex.CompareMode(mode);
2002  return tex;
2003 }
2004 
2005 // CompareFunc
2006 inline DSATextureOps& operator << (
2007  DSATextureOps& tex,
2008  CompareFunction func
2009 )
2010 {
2011  tex.CompareFunc(func);
2012  return tex;
2013 }
2014 
2015 // Wrap
2016 inline DSATextureOps& operator << (
2017  DSATextureOpsAndSlot tas,
2018  TextureWrap wrap
2019 )
2020 {
2021  switch(tas.slot)
2022  {
2023  case 0: tas.tex.WrapS(wrap); break;
2024  case 1: tas.tex.WrapT(wrap); break;
2025  case 2: tas.tex.WrapR(wrap); break;
2026  default: assert(!"Invalid texture wrap slot");
2027  }
2028  return tas.tex;
2029 }
2030 
2031 // Swizzle
2032 inline DSATextureOps& operator << (
2033  DSATextureOps& tex,
2034  TextureSwizzle swizzle
2035 )
2036 {
2037  tex.SwizzleRGBA(swizzle);
2038  return tex;
2039 }
2040 
2041 // Swizzle
2042 inline DSATextureOps& operator << (
2043  DSATextureOpsAndSlot tas,
2044  TextureSwizzle swizzle
2045 )
2046 {
2047  switch(tas.slot)
2048  {
2049  case 0: tas.tex.SwizzleR(swizzle); break;
2050  case 1: tas.tex.SwizzleG(swizzle); break;
2051  case 2: tas.tex.SwizzleB(swizzle); break;
2052  case 3: tas.tex.SwizzleA(swizzle); break;
2053  default: assert(!"Invalid texture swizzle slot");
2054  }
2055  return tas.tex;
2056 }
2057 
2058 // BorderColor
2059 template <typename T>
2060 inline DSATextureOps& operator << (
2061  DSATextureOps& tex,
2062  const Vector<T, 4>& col
2063 )
2064 {
2065  tex.BorderColor(col);
2066  return tex;
2067 }
2068 
2069 /*
2070 // Image
2071 inline DSATextureOps& operator << (
2072  DSATextureOps& tex,
2073  const images::Image& image
2074 )
2075 {
2076  tex.Image(image);
2077  return tex;
2078 }
2079 
2080 // Image
2081 inline DSATextureOps& operator << (
2082  DSATextureOps& tex,
2083  const images::ImageSpec& image_spec
2084 )
2085 {
2086  tex.Image(image_spec);
2087  return tex;
2088 }
2089 
2090 // Image + Level
2091 inline DSATextureOps& operator << (
2092  DSATextureOpsAndSlot tas,
2093  const images::Image& image
2094 )
2095 {
2096  tas.tex.Image(image, tas.slot);
2097  return tas.tex;
2098 }
2099 
2100 // Image + Level
2101 inline DSATextureOps& operator << (
2102  DSATextureOpsAndSlot tas,
2103  const images::ImageSpec& image_spec
2104 )
2105 {
2106  tas.tex.Image(image_spec, tas.slot);
2107  return tas.tex;
2108 }
2109 */
2110 
2111 // GenerateMipmaps
2112 inline DSATextureOps& operator << (
2113  DSATextureOps& tex,
2114  TextureMipmap
2115 )
2116 {
2117  tex.GenerateMipmap();
2118  return tex;
2119 }
2120 
2122 
2125 typedef Object<DSATextureOps> DSATexture;
2126 
2127 #endif // GL_ARB_direct_state_access
2128 
2129 } // namespace oglplus
2130 
2131 #if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
2132 #include <oglplus/dsa/texture.ipp>
2133 #endif // OGLPLUS_LINK_LIBRARY
2134 
2135 #endif // include guard
ObjectOps & Storage3D(GLsizei levels, PixelDataInternalFormat internal_format, GLsizei width, GLsizei height, GLsizei depth)
Specifies all levels of 3D texture at the same time.
Definition: texture.hpp:562
GLsizei DepthSize(GLint level=0) const
Returns the actual resolution of the DEPTH component.
Definition: texture.hpp:330
Vector< GLuint, 4 > BorderColor(TypeTag< GLuint >) const
Gets the texture border color (TEXTURE_BORDER_COLOR)
Definition: texture.hpp:1106
ObjectOps & WrapS(TextureWrap mode)
Sets the wrap parameter (TEXTURE_WRAP_S)
Definition: texture.hpp:1790
OneOf< GLenum, std::tuple< DataType, PixelDataType > > PixDataType
The pixel data type.
Definition: texture.hpp:90
TextureSwizzle
Texture swizzle enumeration.
Definition: texture_swizzle.hpp:53
TextureSwizzle SwizzleA(void) const
Gets the swizzle parameter (TEXTURE_SWIZZLE_A)
Definition: texture.hpp:1618
TextureSwizzle SwizzleG(void) const
Gets the swizzle parameter (TEXTURE_SWIZZLE_G)
Definition: texture.hpp:1570
TextureSwizzleTuple SwizzleRGBA(void) const
Gets the swizzle parameter (TEXTURE_SWIZZLE_RGBA)
Definition: texture.hpp:1642
ObjectOps & MinLOD(GLfloat value)
Sets minimal LOD value (TEXTURE_MIN_LOD)
Definition: texture.hpp:1366
ObjectOps & Storage1D(GLsizei levels, PixelDataInternalFormat internal_format, GLsizei width)
Specifies all levels of 1D texture at the same time.
Definition: texture.hpp:498
GLsizei GreenSize(GLint level=0) const
Returns the actual resolution of the GREEN component.
Definition: texture.hpp:270
ObjectOps & MaxLevel(GLint value)
Sets maximum level value (TEXTURE_MAX_LEVEL)
Definition: texture.hpp:1430
TextureWrap Wrap
Texture wrap mode value.
Definition: texture.hpp:81
GLfloat MinLOD(void) const
Gets minimal LOD value (TEXTURE_MIN_LOD)
Definition: texture.hpp:1355
ObjectOps & Storage2D(GLsizei levels, PixelDataInternalFormat internal_format, GLsizei width, GLsizei height)
Specifies all levels of 2D texture at the same time.
Definition: texture.hpp:529
void GetCompressedImage(GLint level, GLsizei size, GLubyte *buffer) const
Allows to obtain the texture image in compressed form.
Definition: texture.hpp:469
TextureFilter
Texture filter enumeration.
Definition: texture_filter.hpp:29
DataType
OpenGL data type enumeration.
Definition: data_type.hpp:34
TextureWrap WrapR(void) const
Gets the wrap parameter (TEXTURE_WRAP_R)
Definition: texture.hpp:1823
PixelDataInternalFormat
OpenGL pixel data internal format enumeration.
Definition: pixel_data.hpp:79
TextureMagFilter MagFilter
Maginification filter.
Definition: texture.hpp:61
ObjectOps & Anisotropy(GLfloat value)
Sets the anisotropy level.
Definition: texture.hpp:1481
ObjectOps & CopySubImage2D(GLint level, GLint xoffs, GLint yoffs, GLint x, GLint y, GLsizei width, GLsizei height)
Copies a two dimensional texture sub image from the framebuffer.
Definition: texture.hpp:785
Class used for passing the address and size of a writable buffer to functions.
Definition: output_data.hpp:22
TextureSwizzleCoord SwizzleCoord
Texture swizzle coordinate.
Definition: texture.hpp:67
ObjectOps & Buffer(PixelDataInternalFormat internal_format, BufferName buffer)
Assigns a buffer storing the texel data to the texture.
Definition: texture.hpp:961
Vector< GLfloat, 4 > BorderColor(TypeTag< GLfloat >) const
Gets the texture border color (TEXTURE_BORDER_COLOR)
Definition: texture.hpp:1020
PixelDataType BlueType(GLint level=0) const
Returns the data type used to store the BLUE component.
Definition: texture.hpp:192
TextureSwizzle Swizzle
Texture swizzle value.
Definition: texture.hpp:70
TextureMinFilter
Texture minification filter enumeration.
Definition: texture_filter.hpp:71
GLsizei Height(GLint level=0) const
Returns the height of the texture as it was specified by *Image*D.
Definition: texture.hpp:124
ObjectOps & SwizzleRGBA(const TextureSwizzleTuple &modes)
Sets the swizzle parameter (TEXTURE_SWIZZLE_RGBA)
Definition: texture.hpp:1723
bool Seamless(void) const
Gets the seamless cubemap setting value.
Definition: texture.hpp:1885
GLsizei RedSize(GLint level=0) const
Returns the actual resolution of the RED component.
Definition: texture.hpp:250
A tag template used mainly for data-type-based function overload dispatching.
Definition: data_type.hpp:23
ObjectOps & GenerateMipmap(void)
Generate mipmap for the texture bound to the specified target.
Definition: texture.hpp:1917
TextureSwizzle SwizzleR(void) const
Gets the swizzle parameter (TEXTURE_SWIZZLE_R)
Definition: texture.hpp:1546
ObjectOps & LODBias(GLfloat value)
Sets the LOD bias value (TEXTURE_LOD_BIAS)
Definition: texture.hpp:1230
GLint MaxLevel(void) const
Gets maximum level value (TEXTURE_MAX_LEVEL)
Definition: texture.hpp:1419
TextureMinFilter MinFilter
Minification filter.
Definition: texture.hpp:64
TextureSwizzle SwizzleB(void) const
Gets the swizzle parameter (TEXTURE_SWIZZLE_B)
Definition: texture.hpp:1594
TextureMinFilter MinFilter(void) const
Gets the minification filter (TEXTURE_MIN_FILTER)
Definition: texture.hpp:1320
TextureMagFilter
Texture magnification filter enumeration.
Definition: texture_filter.hpp:50
Implements operations applicable to named (non-zero) objects.
Definition: wrap_tpl.hpp:45
ObjectOps & SwizzleB(TextureSwizzle mode)
Sets the swizzle parameter (TEXTURE_SWIZZLE_B)
Definition: texture.hpp:1606
TextureWrap
Texture wrap enumeration.
Definition: texture_wrap.hpp:51
GLuint GetGLName(ObjectName< ObjTag > named)
Returns the GLuint OpenGL name assigned to named object.
Definition: name.hpp:38
TextureTarget
PixelDataType
OpenGL pixel data type enumeration.
Definition: pixel_data.hpp:29
A tuple of swizzle values for all texture components.
Definition: texture_swizzle.hpp:67
ObjectOps & SwizzleRGBA(TextureSwizzle mode)
Sets the swizzle parameter (TEXTURE_SWIZZLE_RGBA)
Definition: texture.hpp:1665
GLsizei SharedSize(GLint level=0) const
Returns the size of all texture components.
Definition: texture.hpp:371
PixelDataFormat
OpenGL pixel data format enumeration.
Definition: pixel_data.hpp:50
TextureCompareMode
Texture compare mode enumeration.
Definition: texture_compare.hpp:29
ObjectOps & SubImage1D(GLint level, GLint xoffs, GLsizei width, PixelDataFormat format, Property::PixDataType type, const void *data)
Specifies a one dimensional texture sub image.
Definition: texture.hpp:705
PixelDataInternalFormat InternalFormat(GLint level=0) const
Returns the internal data format of the image array.
Definition: texture.hpp:399
ObjectOps & CompareFunc(CompareFunction func)
Sets the compare function (TEXTURE_COMPARE_FUNC)
Definition: texture.hpp:1197
TextureCompareMode CompareMode
Depth texture comparison mode.
Definition: texture.hpp:55
ObjectOps & CompressedSubImage3D(GLint level, GLint xoffs, GLint yoffs, GLint zoffs, GLsizei width, GLsizei height, GLsizei depth, PixelDataFormat format, GLsizei image_size, const void *data)
Specifies a three dimensional compressed texture sub image.
Definition: texture.hpp:849
ObjectOps & BorderColor(Vector< GLfloat, 4 > color)
Sets the texture border color (TEXTURE_BORDER_COLOR)
Definition: texture.hpp:1042
Implements operations applicable to any object including object 0 (zero)
Definition: fwd.hpp:157
ObjectOps & SwizzleRGBA(TextureSwizzle mode_r, TextureSwizzle mode_g, TextureSwizzle mode_b, TextureSwizzle mode_a)
Sets the swizzle parameter (TEXTURE_SWIZZLE_RGBA)
Definition: texture.hpp:1690
TextureSwizzle Swizzle(TextureSwizzleCoord coord) const
Gets the swizzle parameter (TEXTURE_SWIZZLE_*)
Definition: texture.hpp:1507
GLfloat Anisotropy(void) const
Gets the current anisotropy level.
Definition: texture.hpp:1466
Object< DSATextureOps > DSATexture
An oglplus_object encapsulating the DSA texture object functionality.
Definition: texture.hpp:2125
GLsizei Width(GLint level=0) const
Returns the width of the texture as it was specified by *Image*D.
Definition: texture.hpp:110
Texture object wrappers.
TextureWrapCoord WrapCoord
Texture wrap mode for coordinate.
Definition: texture.hpp:78
TextureCompareMode CompareMode(void) const
Gets the compare mode (TEXTURE_COMPARE_MODE)
Definition: texture.hpp:1149
Stores a value having one of the listed types in a common representation.
Definition: one_of.hpp:60
GLsizei Depth(GLint level=0) const
Returns the depth of the texture as it was specified by *Image*D.
Definition: texture.hpp:138
ObjectOps & Filter(TextureFilter filter)
Sets both the minification and maginification filter.
Definition: texture.hpp:1252
PixelDataType DepthType(GLint level=0) const
Returns the data type used to store the DEPTH component.
Definition: texture.hpp:230
ObjectOps & BorderColor(Vector< GLint, 4 > color)
Sets the texture border color (TEXTURE_BORDER_COLOR)
Definition: texture.hpp:1085
ObjectOps & WrapR(TextureWrap mode)
Sets the wrap parameter (TEXTURE_WRAP_R)
Definition: texture.hpp:1834
GLsizei BlueSize(GLint level=0) const
Returns the actual resolution of the BLUE component.
Definition: texture.hpp:290
void GetImage(GLint level, PixelDataFormat format, Property::PixDataType type, GLsizei size, GLvoid *buffer) const
Allows to obtain the texture image in uncompressed form.
Definition: texture.hpp:443
Wrapper for (texture) image data.
Definition: image.hpp:45
ObjectOps & DepthStencilMode(PixelDataFormat mode)
Sets the swizzle parameter (DEPTH_STENCIL_TEXTURE_MODE)
Definition: texture.hpp:1861
Exception class for GL object-related errors.
Definition: object.hpp:24
TextureWrap Wrap(TextureWrapCoord coord) const
Gets the wrap parameter (TEXTURE_WRAP_*)
Definition: texture.hpp:1744
ObjectOps & SubImage2D(GLint level, GLint xoffs, GLint yoffs, GLsizei width, GLsizei height, PixelDataFormat format, Property::PixDataType type, const void *data)
Specifies a two dimensional texture sub image.
Definition: texture.hpp:656
ObjectOps & CompressedSubImage1D(GLint level, GLint xoffs, GLsizei width, PixelDataFormat format, GLsizei image_size, const void *data)
Specifies a one dimensional compressed texture sub image.
Definition: texture.hpp:927
GLsizei CompressedImageSize(GLint level=0) const
Returns the size (in bytes) of the image array if it is compressed.
Definition: texture.hpp:385
ObjectOps & Seamless(bool enable)
Sets the seamless cubemap setting.
Definition: texture.hpp:1896
ObjectOps & BorderColor(Vector< GLuint, 4 > color)
Sets the texture border color (TEXTURE_BORDER_COLOR)
Definition: texture.hpp:1128
GLfloat MaxLOD(void) const
Gets maximum LOD value (TEXTURE_MAX_LOD)
Definition: texture.hpp:1387
TextureWrap WrapT(void) const
Gets the wrap parameter (TEXTURE_WRAP_T)
Definition: texture.hpp:1801
TextureSwizzleCoord
Texture swizzle parameter coordinate enumeration.
Definition: texture_swizzle.hpp:29
ObjectOps & MinFilter(TextureMinFilter filter)
Sets the minification filter (TEXTURE_MIN_FILTER)
Definition: texture.hpp:1333
ObjectOps & WrapT(TextureWrap mode)
Sets the wrap parameter (TEXTURE_WRAP_T)
Definition: texture.hpp:1812
TextureWrap WrapS(void) const
Gets the wrap parameter (TEXTURE_WRAP_S)
Definition: texture.hpp:1779
void Bind(Target target) const
Binds this texture to the specified target.
Definition: texture.hpp:330
TextureWrapCoord
Texture wrap parameter coordinate enumeration.
Definition: texture_wrap.hpp:28
ObjectOps & BaseLevel(GLuint level)
Sets the texture base level (TEXTURE_BASE_LEVEL)
Definition: texture.hpp:998
PixelDataFormat DepthStencilMode(void) const
Gets the depth stencil mode parameter (DEPTH_STENCIL_TEXTURE_MODE)
Definition: texture.hpp:1847
TextureMagFilter MagFilter(void) const
Gets the magnification filter (TEXTURE_MAG_FILTER)
Definition: texture.hpp:1285
ObjectOps & CompressedSubImage2D(GLint level, GLint xoffs, GLint yoffs, GLsizei width, GLsizei height, PixelDataFormat format, GLsizei image_size, const void *data)
Specifies a two dimensional compressed texture sub image.
Definition: texture.hpp:890
ObjectOps & MaxLOD(GLfloat value)
Sets maximum LOD value (TEXTURE_MAX_LOD)
Definition: texture.hpp:1398
GLfloat MaxAnisotropy(void) const
Gets the maximum anisotropy level.
Definition: texture.hpp:1451
ObjectOps & SwizzleA(TextureSwizzle mode)
Sets the swizzle parameter (TEXTURE_SWIZZLE_A)
Definition: texture.hpp:1630
ObjectOps & Swizzle(TextureSwizzleCoord coord, TextureSwizzle mode)
Sets the swizzle parameter (TEXTURE_SWIZZLE_*)
Definition: texture.hpp:1520
Implements operations applicable to any object and any operation kind.
Definition: fwd.hpp:151
ObjectOps & CopySubImage1D(GLint level, GLint xoffs, GLint x, GLint y, GLsizei width)
Copies a one dimensional texture sub image from the framebuffer.
Definition: texture.hpp:819
ObjectOps< tag::DirectState, tag::Texture > DSATextureOps
Texture operations with direct state access.
Definition: texture.hpp:1932
GLuint BaseLevel(void) const
Returns the texture base level (TEXTURE_BASE_LEVEL)
Definition: texture.hpp:987
CompareFunction
Comparison function type enumeration.
Definition: compare_function.hpp:30
GLsizei StencilSize(GLint level=0) const
Returns the actual resolution of the STENCIL component.
Definition: texture.hpp:350
PixelDataType RedType(GLint level=0) const
Returns the data type used to store the RED component.
Definition: texture.hpp:154
GLfloat LODBias(void) const
Gets the LOD bias value (TEXTURE_LOD_BIAS)
Definition: texture.hpp:1219
GLsizei AlphaSize(GLint level=0) const
Returns the actual resolution of the ALPHA component.
Definition: texture.hpp:310
ObjectOps & CopySubImage3D(GLint level, GLint xoffs, GLint yoffs, GLint zoffs, GLint x, GLint y, GLsizei width, GLsizei height)
Copies a three dimensional texture sub image from the framebuffer.
Definition: texture.hpp:749
Basic template for vector types.
Definition: fwd.hpp:43
ObjectOps & SubImage3D(GLint level, GLint xoffs, GLint yoffs, GLint zoffs, GLsizei width, GLsizei height, GLsizei depth, PixelDataFormat format, Property::PixDataType type, const void *data)
Specifies a three dimensional texture sub image.
Definition: texture.hpp:602
Vector< GLint, 4 > BorderColor(TypeTag< GLint >) const
Gets the texture border color (TEXTURE_BORDER_COLOR)
Definition: texture.hpp:1063
ObjectOps & SwizzleG(TextureSwizzle mode)
Sets the swizzle parameter (TEXTURE_SWIZZLE_G)
Definition: texture.hpp:1582
ObjectOps & CompareMode(TextureCompareMode mode)
Sets the compare mode (TEXTURE_COMPARE_MODE)
Definition: texture.hpp:1162
CompareFunction CompareFunc(void) const
Sets the compare function (TEXTURE_COMPARE_FUNC)
Definition: texture.hpp:1184
A common template for "named" objects like textures, buffers, etc.
Definition: fwd.hpp:136
TextureFilter Filter
Filter.
Definition: texture.hpp:58
PixelDataType GreenType(GLint level=0) const
Returns the data type used to store the GREEN component.
Definition: texture.hpp:173
PixelDataType AlphaType(GLint level=0) const
Returns the data type used to store the ALPHA component.
Definition: texture.hpp:211
Class wrapping texture object functionality with direct state access.
Definition: texture.hpp:45
ObjectOps & Wrap(TextureWrapCoord coord, TextureWrap mode)
Sets the wrap parameter (TEXTURE_WRAP_*)
Definition: texture.hpp:1754
ObjectOps & SwizzleR(TextureSwizzle mode)
Sets the swizzle parameter (TEXTURE_SWIZZLE_R)
Definition: texture.hpp:1558
ObjectOps & MagFilter(TextureMagFilter filter)
Sets the magnification filter (TEXTURE_MAG_FILTER)
Definition: texture.hpp:1298

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).