1641
1578
GLdouble *zNear = (GLdouble *) bp; bp += 8;
1642
1579
GLdouble *zFar = (GLdouble *) bp; bp += 8;
1643
1580
weglOrtho(*left,*right,*bottom,*top,*zNear,*zFar);
1645
case 5203: { // glPassThrough
1582
case 5203: { // glPassThrough
1646
1583
GLfloat *token = (GLfloat *) bp; bp += 4;
1647
1584
weglPassThrough(*token);
1649
case 5204: { // glPixelMapfv
1586
case 5204: { // glPixelMapfv
1650
1587
GLenum *map = (GLenum *) bp; bp += 4;
1651
1588
GLsizei *mapsize = (GLsizei *) bp; bp += 4;
1652
GLfloat *values = (GLfloat *) bins[0]->base;
1589
GLfloat *values = (GLfloat *) bins[0];
1653
1590
weglPixelMapfv(*map,*mapsize,values);
1655
case 5205: { // glPixelMapuiv
1592
case 5205: { // glPixelMapuiv
1656
1593
GLenum *map = (GLenum *) bp; bp += 4;
1657
1594
GLsizei *mapsize = (GLsizei *) bp; bp += 4;
1658
GLuint *values = (GLuint *) bins[0]->base;
1595
GLuint *values = (GLuint *) bins[0];
1659
1596
weglPixelMapuiv(*map,*mapsize,values);
1661
case 5206: { // glPixelMapusv
1598
case 5206: { // glPixelMapusv
1662
1599
GLenum *map = (GLenum *) bp; bp += 4;
1663
1600
GLsizei *mapsize = (GLsizei *) bp; bp += 4;
1664
GLushort *values = (GLushort *) bins[0]->base;
1601
GLushort *values = (GLushort *) bins[0];
1665
1602
weglPixelMapusv(*map,*mapsize,values);
1667
case 5207: { // glPixelStoref
1604
case 5207: { // glPixelStoref
1668
1605
GLenum *pname = (GLenum *) bp; bp += 4;
1669
1606
GLfloat *param = (GLfloat *) bp; bp += 4;
1670
1607
weglPixelStoref(*pname,*param);
1672
case 5208: { // glPixelStorei
1609
case 5208: { // glPixelStorei
1673
1610
GLenum *pname = (GLenum *) bp; bp += 4;
1674
1611
GLint *param = (GLint *) bp; bp += 4;
1675
1612
weglPixelStorei(*pname,*param);
1677
case 5209: { // glPixelTransferf
1614
case 5209: { // glPixelTransferf
1678
1615
GLenum *pname = (GLenum *) bp; bp += 4;
1679
1616
GLfloat *param = (GLfloat *) bp; bp += 4;
1680
1617
weglPixelTransferf(*pname,*param);
1682
case 5210: { // glPixelTransferi
1619
case 5210: { // glPixelTransferi
1683
1620
GLenum *pname = (GLenum *) bp; bp += 4;
1684
1621
GLint *param = (GLint *) bp; bp += 4;
1685
1622
weglPixelTransferi(*pname,*param);
1687
case 5211: { // glPixelZoom
1624
case 5211: { // glPixelZoom
1688
1625
GLfloat *xfactor = (GLfloat *) bp; bp += 4;
1689
1626
GLfloat *yfactor = (GLfloat *) bp; bp += 4;
1690
1627
weglPixelZoom(*xfactor,*yfactor);
1692
case 5212: { // glPointSize
1629
case 5212: { // glPointSize
1693
1630
GLfloat *size = (GLfloat *) bp; bp += 4;
1694
1631
weglPointSize(*size);
1696
case 5213: { // glPolygonMode
1633
case 5213: { // glPolygonMode
1697
1634
GLenum *face = (GLenum *) bp; bp += 4;
1698
1635
GLenum *mode = (GLenum *) bp; bp += 4;
1699
1636
weglPolygonMode(*face,*mode);
1701
case 5214: { // glPolygonOffset
1638
case 5214: { // glPolygonOffset
1702
1639
GLfloat *factor = (GLfloat *) bp; bp += 4;
1703
1640
GLfloat *units = (GLfloat *) bp; bp += 4;
1704
1641
weglPolygonOffset(*factor,*units);
1706
case 5215: { // glPolygonStipple
1707
GLubyte *mask = (GLubyte *) bins[0]->base;
1643
case 5215: { // glPolygonStipple
1644
GLubyte *mask = (GLubyte *) bins[0];
1708
1645
weglPolygonStipple(mask);
1710
case 5216: { // glPopAttrib
1647
case 5216: { // glPopAttrib
1711
1648
weglPopAttrib();
1713
case 5217: { // glPopClientAttrib
1650
case 5217: { // glPopClientAttrib
1714
1651
weglPopClientAttrib();
1716
case 5218: { // glPopMatrix
1653
case 5218: { // glPopMatrix
1717
1654
weglPopMatrix();
1719
case 5219: { // glPopName
1656
case 5219: { // glPopName
1722
case 5220: { // glPrioritizeTextures
1659
case 5220: { // glPrioritizeTextures
1723
1660
int * texturesLen = (int *) bp; bp += 4;
1724
1661
GLuint * textures = (GLuint *) bp; bp += (8-((*texturesLen*4+4)%8))%8;
1725
1662
int * prioritiesLen = (int *) bp; bp += 4;
1726
1663
GLclampf * priorities = (GLclampf *) bp; bp += (8-((*prioritiesLen*4+4)%8))%8;
1727
1664
weglPrioritizeTextures(*texturesLen,textures,priorities);
1729
case 5221: { // glPushAttrib
1666
case 5221: { // glPushAttrib
1730
1667
GLbitfield *mask = (GLbitfield *) bp; bp += 4;
1731
1668
weglPushAttrib(*mask);
1733
case 5222: { // glPushClientAttrib
1670
case 5222: { // glPushClientAttrib
1734
1671
GLbitfield *mask = (GLbitfield *) bp; bp += 4;
1735
1672
weglPushClientAttrib(*mask);
1737
case 5223: { // glPushMatrix
1674
case 5223: { // glPushMatrix
1738
1675
weglPushMatrix();
1740
case 5224: { // glPushName
1677
case 5224: { // glPushName
1741
1678
GLuint *name = (GLuint *) bp; bp += 4;
1742
1679
weglPushName(*name);
1744
case 5225: { // glRasterPos2dv
1681
case 5225: { // glRasterPos2dv
1745
1682
GLdouble *v = (GLdouble *) bp; bp += 8;
1746
1683
weglRasterPos2dv(v);
1748
case 5226: { // glRasterPos2fv
1685
case 5226: { // glRasterPos2fv
1749
1686
GLfloat *v = (GLfloat *) bp; bp += 4;
1750
1687
weglRasterPos2fv(v);
1752
case 5227: { // glRasterPos2iv
1689
case 5227: { // glRasterPos2iv
1753
1690
GLint *v = (GLint *) bp; bp += 4;
1754
1691
weglRasterPos2iv(v);
1756
case 5228: { // glRasterPos2sv
1693
case 5228: { // glRasterPos2sv
1757
1694
GLshort *v = (GLshort *) bp; bp += 2;
1758
1695
weglRasterPos2sv(v);
1760
case 5229: { // glRasterPos3dv
1697
case 5229: { // glRasterPos3dv
1761
1698
GLdouble *v = (GLdouble *) bp; bp += 8;
1762
1699
weglRasterPos3dv(v);
1764
case 5230: { // glRasterPos3fv
1701
case 5230: { // glRasterPos3fv
1765
1702
GLfloat *v = (GLfloat *) bp; bp += 4;
1766
1703
weglRasterPos3fv(v);
1768
case 5231: { // glRasterPos3iv
1705
case 5231: { // glRasterPos3iv
1769
1706
GLint *v = (GLint *) bp; bp += 4;
1770
1707
weglRasterPos3iv(v);
1772
case 5232: { // glRasterPos3sv
1709
case 5232: { // glRasterPos3sv
1773
1710
GLshort *v = (GLshort *) bp; bp += 2;
1774
1711
weglRasterPos3sv(v);
1776
case 5233: { // glRasterPos4dv
1713
case 5233: { // glRasterPos4dv
1777
1714
GLdouble *v = (GLdouble *) bp; bp += 8;
1778
1715
weglRasterPos4dv(v);
1780
case 5234: { // glRasterPos4fv
1717
case 5234: { // glRasterPos4fv
1781
1718
GLfloat *v = (GLfloat *) bp; bp += 4;
1782
1719
weglRasterPos4fv(v);
1784
case 5235: { // glRasterPos4iv
1721
case 5235: { // glRasterPos4iv
1785
1722
GLint *v = (GLint *) bp; bp += 4;
1786
1723
weglRasterPos4iv(v);
1788
case 5236: { // glRasterPos4sv
1725
case 5236: { // glRasterPos4sv
1789
1726
GLshort *v = (GLshort *) bp; bp += 2;
1790
1727
weglRasterPos4sv(v);
1792
case 5237: { // glReadBuffer
1729
case 5237: { // glReadBuffer
1793
1730
GLenum *mode = (GLenum *) bp; bp += 4;
1794
1731
weglReadBuffer(*mode);
1796
case 5238: { // glReadPixels
1733
case 5238: { // glReadPixels
1797
1734
GLint *x = (GLint *) bp; bp += 4;
1798
1735
GLint *y = (GLint *) bp; bp += 4;
1799
1736
GLsizei *width = (GLsizei *) bp; bp += 4;
1800
1737
GLsizei *height = (GLsizei *) bp; bp += 4;
1801
1738
GLenum *format = (GLenum *) bp; bp += 4;
1802
1739
GLenum *type = (GLenum *) bp; bp += 4;
1803
GLvoid *pixels = (GLvoid *) bins[0]->base;
1740
GLvoid *pixels = (GLvoid *) bins[0];
1804
1741
weglReadPixels(*x,*y,*width,*height,*format,*type,pixels);
1805
1742
int AP = 0; ErlDrvTermData rt[6];
1806
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
1743
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
1807
1744
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
1808
1745
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
1809
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
1811
case 5239: { // glRectd
1746
driver_send_term(port,caller,rt,AP);
1748
case 5239: { // glRectd
1812
1749
GLdouble *x1 = (GLdouble *) bp; bp += 8;
1813
1750
GLdouble *y1 = (GLdouble *) bp; bp += 8;
1814
1751
GLdouble *x2 = (GLdouble *) bp; bp += 8;
1815
1752
GLdouble *y2 = (GLdouble *) bp; bp += 8;
1816
1753
weglRectd(*x1,*y1,*x2,*y2);
1818
case 5240: { // glRectdv
1755
case 5240: { // glRectdv
1819
1756
GLdouble * v1 = (GLdouble *) bp; bp += 16;
1820
1757
GLdouble * v2 = (GLdouble *) bp; bp += 16;
1821
1758
weglRectdv(v1,v2);
1823
case 5241: { // glRectf
1760
case 5241: { // glRectf
1824
1761
GLfloat *x1 = (GLfloat *) bp; bp += 4;
1825
1762
GLfloat *y1 = (GLfloat *) bp; bp += 4;
1826
1763
GLfloat *x2 = (GLfloat *) bp; bp += 4;
1827
1764
GLfloat *y2 = (GLfloat *) bp; bp += 4;
1828
1765
weglRectf(*x1,*y1,*x2,*y2);
1830
case 5242: { // glRectfv
1767
case 5242: { // glRectfv
1831
1768
GLfloat * v1 = (GLfloat *) bp; bp += 8;
1832
1769
GLfloat * v2 = (GLfloat *) bp; bp += 8;
1833
1770
weglRectfv(v1,v2);
1835
case 5243: { // glRecti
1772
case 5243: { // glRecti
1836
1773
GLint *x1 = (GLint *) bp; bp += 4;
1837
1774
GLint *y1 = (GLint *) bp; bp += 4;
1838
1775
GLint *x2 = (GLint *) bp; bp += 4;
1839
1776
GLint *y2 = (GLint *) bp; bp += 4;
1840
1777
weglRecti(*x1,*y1,*x2,*y2);
1842
case 5244: { // glRectiv
1779
case 5244: { // glRectiv
1843
1780
GLint * v1 = (GLint *) bp; bp += 8;
1844
1781
GLint * v2 = (GLint *) bp; bp += 8;
1845
1782
weglRectiv(v1,v2);
1847
case 5245: { // glRects
1784
case 5245: { // glRects
1848
1785
GLshort *x1 = (GLshort *) bp; bp += 2;
1849
1786
GLshort *y1 = (GLshort *) bp; bp += 2;
1850
1787
GLshort *x2 = (GLshort *) bp; bp += 2;
1851
1788
GLshort *y2 = (GLshort *) bp; bp += 2;
1852
1789
weglRects(*x1,*y1,*x2,*y2);
1854
case 5246: { // glRectsv
1791
case 5246: { // glRectsv
1855
1792
GLshort * v1 = (GLshort *) bp; bp += 4;
1856
1793
GLshort * v2 = (GLshort *) bp; bp += 4;
1857
1794
weglRectsv(v1,v2);
1859
case 5247: { // glRenderMode
1796
case 5247: { // glRenderMode
1860
1797
GLenum *mode = (GLenum *) bp; bp += 4;
1861
1798
GLint result = weglRenderMode(*mode);
1862
1799
int AP = 0; ErlDrvTermData rt[6];
1863
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
1800
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
1864
1801
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
1865
1802
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
1866
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
1867
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
1869
case 5248: { // glRotated
1803
driver_send_term(port,caller,rt,AP);
1805
case 5248: { // glRotated
1870
1806
GLdouble *angle = (GLdouble *) bp; bp += 8;
1871
1807
GLdouble *x = (GLdouble *) bp; bp += 8;
1872
1808
GLdouble *y = (GLdouble *) bp; bp += 8;
1873
1809
GLdouble *z = (GLdouble *) bp; bp += 8;
1874
1810
weglRotated(*angle,*x,*y,*z);
1876
case 5249: { // glRotatef
1812
case 5249: { // glRotatef
1877
1813
GLfloat *angle = (GLfloat *) bp; bp += 4;
1878
1814
GLfloat *x = (GLfloat *) bp; bp += 4;
1879
1815
GLfloat *y = (GLfloat *) bp; bp += 4;
1880
1816
GLfloat *z = (GLfloat *) bp; bp += 4;
1881
1817
weglRotatef(*angle,*x,*y,*z);
1883
case 5250: { // glScaled
1819
case 5250: { // glScaled
1884
1820
GLdouble *x = (GLdouble *) bp; bp += 8;
1885
1821
GLdouble *y = (GLdouble *) bp; bp += 8;
1886
1822
GLdouble *z = (GLdouble *) bp; bp += 8;
1887
1823
weglScaled(*x,*y,*z);
1889
case 5251: { // glScalef
1825
case 5251: { // glScalef
1890
1826
GLfloat *x = (GLfloat *) bp; bp += 4;
1891
1827
GLfloat *y = (GLfloat *) bp; bp += 4;
1892
1828
GLfloat *z = (GLfloat *) bp; bp += 4;
1893
1829
weglScalef(*x,*y,*z);
1895
case 5252: { // glScissor
1831
case 5252: { // glScissor
1896
1832
GLint *x = (GLint *) bp; bp += 4;
1897
1833
GLint *y = (GLint *) bp; bp += 4;
1898
1834
GLsizei *width = (GLsizei *) bp; bp += 4;
1899
1835
GLsizei *height = (GLsizei *) bp; bp += 4;
1900
1836
weglScissor(*x,*y,*width,*height);
1902
case 5253: { // glSelectBuffer
1838
case 5253: { // glSelectBuffer
1903
1839
GLsizei *size = (GLsizei *) bp; bp += 4;
1904
GLuint *buffer = (GLuint *) bins[0]->base;
1840
GLuint *buffer = (GLuint *) bins[0];
1905
1841
weglSelectBuffer(*size,buffer);
1906
1842
int AP = 0; ErlDrvTermData rt[6];
1907
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
1843
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
1908
1844
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
1909
1845
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
1910
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
1912
case 5254: { // glShadeModel
1846
driver_send_term(port,caller,rt,AP);
1848
case 5254: { // glShadeModel
1913
1849
GLenum *mode = (GLenum *) bp; bp += 4;
1914
1850
weglShadeModel(*mode);
1916
case 5255: { // glStencilFunc
1852
case 5255: { // glStencilFunc
1917
1853
GLenum *func = (GLenum *) bp; bp += 4;
1918
1854
GLint *ref = (GLint *) bp; bp += 4;
1919
1855
GLuint *mask = (GLuint *) bp; bp += 4;
1920
1856
weglStencilFunc(*func,*ref,*mask);
1922
case 5256: { // glStencilMask
1858
case 5256: { // glStencilMask
1923
1859
GLuint *mask = (GLuint *) bp; bp += 4;
1924
1860
weglStencilMask(*mask);
1926
case 5257: { // glStencilOp
1862
case 5257: { // glStencilOp
1927
1863
GLenum *fail = (GLenum *) bp; bp += 4;
1928
1864
GLenum *zfail = (GLenum *) bp; bp += 4;
1929
1865
GLenum *zpass = (GLenum *) bp; bp += 4;
1930
1866
weglStencilOp(*fail,*zfail,*zpass);
1932
case 5258: { // glTexCoord1dv
1868
case 5258: { // glTexCoord1dv
1933
1869
GLdouble *v = (GLdouble *) bp; bp += 8;
1934
1870
weglTexCoord1dv(v);
1936
case 5259: { // glTexCoord1fv
1872
case 5259: { // glTexCoord1fv
1937
1873
GLfloat *v = (GLfloat *) bp; bp += 4;
1938
1874
weglTexCoord1fv(v);
1940
case 5260: { // glTexCoord1iv
1876
case 5260: { // glTexCoord1iv
1941
1877
GLint *v = (GLint *) bp; bp += 4;
1942
1878
weglTexCoord1iv(v);
1944
case 5261: { // glTexCoord1sv
1880
case 5261: { // glTexCoord1sv
1945
1881
GLshort *v = (GLshort *) bp; bp += 2;
1946
1882
weglTexCoord1sv(v);
1948
case 5262: { // glTexCoord2dv
1884
case 5262: { // glTexCoord2dv
1949
1885
GLdouble *v = (GLdouble *) bp; bp += 8;
1950
1886
weglTexCoord2dv(v);
1952
case 5263: { // glTexCoord2fv
1888
case 5263: { // glTexCoord2fv
1953
1889
GLfloat *v = (GLfloat *) bp; bp += 4;
1954
1890
weglTexCoord2fv(v);
1956
case 5264: { // glTexCoord2iv
1892
case 5264: { // glTexCoord2iv
1957
1893
GLint *v = (GLint *) bp; bp += 4;
1958
1894
weglTexCoord2iv(v);
1960
case 5265: { // glTexCoord2sv
1896
case 5265: { // glTexCoord2sv
1961
1897
GLshort *v = (GLshort *) bp; bp += 2;
1962
1898
weglTexCoord2sv(v);
1964
case 5266: { // glTexCoord3dv
1900
case 5266: { // glTexCoord3dv
1965
1901
GLdouble *v = (GLdouble *) bp; bp += 8;
1966
1902
weglTexCoord3dv(v);
1968
case 5267: { // glTexCoord3fv
1904
case 5267: { // glTexCoord3fv
1969
1905
GLfloat *v = (GLfloat *) bp; bp += 4;
1970
1906
weglTexCoord3fv(v);
1972
case 5268: { // glTexCoord3iv
1908
case 5268: { // glTexCoord3iv
1973
1909
GLint *v = (GLint *) bp; bp += 4;
1974
1910
weglTexCoord3iv(v);
1976
case 5269: { // glTexCoord3sv
1912
case 5269: { // glTexCoord3sv
1977
1913
GLshort *v = (GLshort *) bp; bp += 2;
1978
1914
weglTexCoord3sv(v);
1980
case 5270: { // glTexCoord4dv
1916
case 5270: { // glTexCoord4dv
1981
1917
GLdouble *v = (GLdouble *) bp; bp += 8;
1982
1918
weglTexCoord4dv(v);
1984
case 5271: { // glTexCoord4fv
1920
case 5271: { // glTexCoord4fv
1985
1921
GLfloat *v = (GLfloat *) bp; bp += 4;
1986
1922
weglTexCoord4fv(v);
1988
case 5272: { // glTexCoord4iv
1924
case 5272: { // glTexCoord4iv
1989
1925
GLint *v = (GLint *) bp; bp += 4;
1990
1926
weglTexCoord4iv(v);
1992
case 5273: { // glTexCoord4sv
1928
case 5273: { // glTexCoord4sv
1993
1929
GLshort *v = (GLshort *) bp; bp += 2;
1994
1930
weglTexCoord4sv(v);
1996
case 5274: { // glTexCoordPointer
1932
case 5274: { // glTexCoordPointer
1997
1933
GLint *size = (GLint *) bp; bp += 4;
1998
1934
GLenum *type = (GLenum *) bp; bp += 4;
1999
1935
GLsizei *stride = (GLsizei *) bp; bp += 4;
2000
1936
GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4;
2001
1937
weglTexCoordPointer(*size,*type,*stride,pointer);
2003
case 5275: { // glTexCoordPointer
1939
case 5275: { // glTexCoordPointer
2004
1940
GLint *size = (GLint *) bp; bp += 4;
2005
1941
GLenum *type = (GLenum *) bp; bp += 4;
2006
1942
GLsizei *stride = (GLsizei *) bp; bp += 4;
2007
GLvoid *pointer = (GLvoid *) bins[0]->base;
1943
GLvoid *pointer = (GLvoid *) bins[0];
2008
1944
weglTexCoordPointer(*size,*type,*stride,pointer);
2010
case 5276: { // glTexEnvf
1946
case 5276: { // glTexEnvf
2011
1947
GLenum *target = (GLenum *) bp; bp += 4;
2012
1948
GLenum *pname = (GLenum *) bp; bp += 4;
2013
1949
GLfloat *param = (GLfloat *) bp; bp += 4;
2014
1950
weglTexEnvf(*target,*pname,*param);
2016
case 5277: { // glTexEnvfv
1952
case 5277: { // glTexEnvfv
2017
1953
GLenum *target = (GLenum *) bp; bp += 4;
2018
1954
GLenum *pname = (GLenum *) bp; bp += 4;
2019
1955
int *paramsLen = (int *) bp; bp += 4;
2020
1956
GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
2021
1957
weglTexEnvfv(*target,*pname,params);
2023
case 5278: { // glTexEnvi
1959
case 5278: { // glTexEnvi
2024
1960
GLenum *target = (GLenum *) bp; bp += 4;
2025
1961
GLenum *pname = (GLenum *) bp; bp += 4;
2026
1962
GLint *param = (GLint *) bp; bp += 4;
2027
1963
weglTexEnvi(*target,*pname,*param);
2029
case 5279: { // glTexEnviv
1965
case 5279: { // glTexEnviv
2030
1966
GLenum *target = (GLenum *) bp; bp += 4;
2031
1967
GLenum *pname = (GLenum *) bp; bp += 4;
2032
1968
int *paramsLen = (int *) bp; bp += 4;
2033
1969
GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
2034
1970
weglTexEnviv(*target,*pname,params);
2036
case 5280: { // glTexGend
1972
case 5280: { // glTexGend
2037
1973
GLenum *coord = (GLenum *) bp; bp += 4;
2038
1974
GLenum *pname = (GLenum *) bp; bp += 4;
2039
1975
GLdouble *param = (GLdouble *) bp; bp += 8;
2040
1976
weglTexGend(*coord,*pname,*param);
2042
case 5281: { // glTexGendv
1978
case 5281: { // glTexGendv
2043
1979
GLenum *coord = (GLenum *) bp; bp += 4;
2044
1980
GLenum *pname = (GLenum *) bp; bp += 4;
2045
1981
int *paramsLen = (int *) bp; bp += 8;
2046
1982
GLdouble *params = (GLdouble *) bp; bp += *paramsLen*8;
2047
1983
weglTexGendv(*coord,*pname,params);
2049
case 5282: { // glTexGenf
1985
case 5282: { // glTexGenf
2050
1986
GLenum *coord = (GLenum *) bp; bp += 4;
2051
1987
GLenum *pname = (GLenum *) bp; bp += 4;
2052
1988
GLfloat *param = (GLfloat *) bp; bp += 4;
2053
1989
weglTexGenf(*coord,*pname,*param);
2055
case 5283: { // glTexGenfv
1991
case 5283: { // glTexGenfv
2056
1992
GLenum *coord = (GLenum *) bp; bp += 4;
2057
1993
GLenum *pname = (GLenum *) bp; bp += 4;
2058
1994
int *paramsLen = (int *) bp; bp += 4;
2059
1995
GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
2060
1996
weglTexGenfv(*coord,*pname,params);
2062
case 5284: { // glTexGeni
1998
case 5284: { // glTexGeni
2063
1999
GLenum *coord = (GLenum *) bp; bp += 4;
2064
2000
GLenum *pname = (GLenum *) bp; bp += 4;
2065
2001
GLint *param = (GLint *) bp; bp += 4;
2066
2002
weglTexGeni(*coord,*pname,*param);
2068
case 5285: { // glTexGeniv
2004
case 5285: { // glTexGeniv
2069
2005
GLenum *coord = (GLenum *) bp; bp += 4;
2070
2006
GLenum *pname = (GLenum *) bp; bp += 4;
2071
2007
int *paramsLen = (int *) bp; bp += 4;
2072
2008
GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
2073
2009
weglTexGeniv(*coord,*pname,params);
2075
case 5286: { // glTexImage1D
2076
GLenum *target = (GLenum *) bp; bp += 4;
2077
GLint *level = (GLint *) bp; bp += 4;
2078
GLint *internalformat = (GLint *) bp; bp += 4;
2079
GLsizei *width = (GLsizei *) bp; bp += 4;
2080
GLint *border = (GLint *) bp; bp += 4;
2081
GLenum *format = (GLenum *) bp; bp += 4;
2082
GLenum *type = (GLenum *) bp; bp += 4;
2083
GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4;
2084
weglTexImage1D(*target,*level,*internalformat,*width,*border,*format,*type,pixels);
2086
case 5287: { // glTexImage1D
2087
GLenum *target = (GLenum *) bp; bp += 4;
2088
GLint *level = (GLint *) bp; bp += 4;
2089
GLint *internalformat = (GLint *) bp; bp += 4;
2090
GLsizei *width = (GLsizei *) bp; bp += 4;
2091
GLint *border = (GLint *) bp; bp += 4;
2092
GLenum *format = (GLenum *) bp; bp += 4;
2093
GLenum *type = (GLenum *) bp; bp += 4;
2094
GLvoid *pixels = (GLvoid *) bins[0]->base;
2095
weglTexImage1D(*target,*level,*internalformat,*width,*border,*format,*type,pixels);
2097
case 5288: { // glTexImage2D
2098
GLenum *target = (GLenum *) bp; bp += 4;
2099
GLint *level = (GLint *) bp; bp += 4;
2100
GLint *internalformat = (GLint *) bp; bp += 4;
2101
GLsizei *width = (GLsizei *) bp; bp += 4;
2102
GLsizei *height = (GLsizei *) bp; bp += 4;
2103
GLint *border = (GLint *) bp; bp += 4;
2104
GLenum *format = (GLenum *) bp; bp += 4;
2105
GLenum *type = (GLenum *) bp; bp += 4;
2106
GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4;
2107
weglTexImage2D(*target,*level,*internalformat,*width,*height,*border,*format,*type,pixels);
2109
case 5289: { // glTexImage2D
2110
GLenum *target = (GLenum *) bp; bp += 4;
2111
GLint *level = (GLint *) bp; bp += 4;
2112
GLint *internalformat = (GLint *) bp; bp += 4;
2113
GLsizei *width = (GLsizei *) bp; bp += 4;
2114
GLsizei *height = (GLsizei *) bp; bp += 4;
2115
GLint *border = (GLint *) bp; bp += 4;
2116
GLenum *format = (GLenum *) bp; bp += 4;
2117
GLenum *type = (GLenum *) bp; bp += 4;
2118
GLvoid *pixels = (GLvoid *) bins[0]->base;
2119
weglTexImage2D(*target,*level,*internalformat,*width,*height,*border,*format,*type,pixels);
2121
case 5290: { // glTexParameterf
2011
case 5286: { // glTexImage1D
2012
GLenum *target = (GLenum *) bp; bp += 4;
2013
GLint *level = (GLint *) bp; bp += 4;
2014
GLint *internalformat = (GLint *) bp; bp += 4;
2015
GLsizei *width = (GLsizei *) bp; bp += 4;
2016
GLint *border = (GLint *) bp; bp += 4;
2017
GLenum *format = (GLenum *) bp; bp += 4;
2018
GLenum *type = (GLenum *) bp; bp += 4;
2019
GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4;
2020
weglTexImage1D(*target,*level,*internalformat,*width,*border,*format,*type,pixels);
2022
case 5287: { // glTexImage1D
2023
GLenum *target = (GLenum *) bp; bp += 4;
2024
GLint *level = (GLint *) bp; bp += 4;
2025
GLint *internalformat = (GLint *) bp; bp += 4;
2026
GLsizei *width = (GLsizei *) bp; bp += 4;
2027
GLint *border = (GLint *) bp; bp += 4;
2028
GLenum *format = (GLenum *) bp; bp += 4;
2029
GLenum *type = (GLenum *) bp; bp += 4;
2030
GLvoid *pixels = (GLvoid *) bins[0];
2031
weglTexImage1D(*target,*level,*internalformat,*width,*border,*format,*type,pixels);
2033
case 5288: { // glTexImage2D
2034
GLenum *target = (GLenum *) bp; bp += 4;
2035
GLint *level = (GLint *) bp; bp += 4;
2036
GLint *internalformat = (GLint *) bp; bp += 4;
2037
GLsizei *width = (GLsizei *) bp; bp += 4;
2038
GLsizei *height = (GLsizei *) bp; bp += 4;
2039
GLint *border = (GLint *) bp; bp += 4;
2040
GLenum *format = (GLenum *) bp; bp += 4;
2041
GLenum *type = (GLenum *) bp; bp += 4;
2042
GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4;
2043
weglTexImage2D(*target,*level,*internalformat,*width,*height,*border,*format,*type,pixels);
2045
case 5289: { // glTexImage2D
2046
GLenum *target = (GLenum *) bp; bp += 4;
2047
GLint *level = (GLint *) bp; bp += 4;
2048
GLint *internalformat = (GLint *) bp; bp += 4;
2049
GLsizei *width = (GLsizei *) bp; bp += 4;
2050
GLsizei *height = (GLsizei *) bp; bp += 4;
2051
GLint *border = (GLint *) bp; bp += 4;
2052
GLenum *format = (GLenum *) bp; bp += 4;
2053
GLenum *type = (GLenum *) bp; bp += 4;
2054
GLvoid *pixels = (GLvoid *) bins[0];
2055
weglTexImage2D(*target,*level,*internalformat,*width,*height,*border,*format,*type,pixels);
2057
case 5290: { // glTexParameterf
2122
2058
GLenum *target = (GLenum *) bp; bp += 4;
2123
2059
GLenum *pname = (GLenum *) bp; bp += 4;
2124
2060
GLfloat *param = (GLfloat *) bp; bp += 4;
2125
2061
weglTexParameterf(*target,*pname,*param);
2127
case 5291: { // glTexParameterfv
2063
case 5291: { // glTexParameterfv
2128
2064
GLenum *target = (GLenum *) bp; bp += 4;
2129
2065
GLenum *pname = (GLenum *) bp; bp += 4;
2130
2066
int *paramsLen = (int *) bp; bp += 4;
2131
2067
GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
2132
2068
weglTexParameterfv(*target,*pname,params);
2134
case 5292: { // glTexParameteri
2070
case 5292: { // glTexParameteri
2135
2071
GLenum *target = (GLenum *) bp; bp += 4;
2136
2072
GLenum *pname = (GLenum *) bp; bp += 4;
2137
2073
GLint *param = (GLint *) bp; bp += 4;
2138
2074
weglTexParameteri(*target,*pname,*param);
2140
case 5293: { // glTexParameteriv
2076
case 5293: { // glTexParameteriv
2141
2077
GLenum *target = (GLenum *) bp; bp += 4;
2142
2078
GLenum *pname = (GLenum *) bp; bp += 4;
2143
2079
int *paramsLen = (int *) bp; bp += 4;
2144
2080
GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+1)%2*4;
2145
2081
weglTexParameteriv(*target,*pname,params);
2147
case 5294: { // glTexSubImage1D
2148
GLenum *target = (GLenum *) bp; bp += 4;
2149
GLint *level = (GLint *) bp; bp += 4;
2150
GLint *xoffset = (GLint *) bp; bp += 4;
2151
GLsizei *width = (GLsizei *) bp; bp += 4;
2152
GLenum *format = (GLenum *) bp; bp += 4;
2153
GLenum *type = (GLenum *) bp; bp += 4;
2154
GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4;
2155
weglTexSubImage1D(*target,*level,*xoffset,*width,*format,*type,pixels);
2157
case 5295: { // glTexSubImage1D
2158
GLenum *target = (GLenum *) bp; bp += 4;
2159
GLint *level = (GLint *) bp; bp += 4;
2160
GLint *xoffset = (GLint *) bp; bp += 4;
2161
GLsizei *width = (GLsizei *) bp; bp += 4;
2162
GLenum *format = (GLenum *) bp; bp += 4;
2163
GLenum *type = (GLenum *) bp; bp += 4;
2164
GLvoid *pixels = (GLvoid *) bins[0]->base;
2165
weglTexSubImage1D(*target,*level,*xoffset,*width,*format,*type,pixels);
2167
case 5296: { // glTexSubImage2D
2168
GLenum *target = (GLenum *) bp; bp += 4;
2169
GLint *level = (GLint *) bp; bp += 4;
2170
GLint *xoffset = (GLint *) bp; bp += 4;
2171
GLint *yoffset = (GLint *) bp; bp += 4;
2172
GLsizei *width = (GLsizei *) bp; bp += 4;
2173
GLsizei *height = (GLsizei *) bp; bp += 4;
2174
GLenum *format = (GLenum *) bp; bp += 4;
2175
GLenum *type = (GLenum *) bp; bp += 4;
2176
GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4;
2177
weglTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*type,pixels);
2179
case 5297: { // glTexSubImage2D
2180
GLenum *target = (GLenum *) bp; bp += 4;
2181
GLint *level = (GLint *) bp; bp += 4;
2182
GLint *xoffset = (GLint *) bp; bp += 4;
2183
GLint *yoffset = (GLint *) bp; bp += 4;
2184
GLsizei *width = (GLsizei *) bp; bp += 4;
2185
GLsizei *height = (GLsizei *) bp; bp += 4;
2186
GLenum *format = (GLenum *) bp; bp += 4;
2187
GLenum *type = (GLenum *) bp; bp += 4;
2188
GLvoid *pixels = (GLvoid *) bins[0]->base;
2189
weglTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*type,pixels);
2191
case 5298: { // glTranslated
2083
case 5294: { // glTexSubImage1D
2084
GLenum *target = (GLenum *) bp; bp += 4;
2085
GLint *level = (GLint *) bp; bp += 4;
2086
GLint *xoffset = (GLint *) bp; bp += 4;
2087
GLsizei *width = (GLsizei *) bp; bp += 4;
2088
GLenum *format = (GLenum *) bp; bp += 4;
2089
GLenum *type = (GLenum *) bp; bp += 4;
2090
GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4;
2091
weglTexSubImage1D(*target,*level,*xoffset,*width,*format,*type,pixels);
2093
case 5295: { // glTexSubImage1D
2094
GLenum *target = (GLenum *) bp; bp += 4;
2095
GLint *level = (GLint *) bp; bp += 4;
2096
GLint *xoffset = (GLint *) bp; bp += 4;
2097
GLsizei *width = (GLsizei *) bp; bp += 4;
2098
GLenum *format = (GLenum *) bp; bp += 4;
2099
GLenum *type = (GLenum *) bp; bp += 4;
2100
GLvoid *pixels = (GLvoid *) bins[0];
2101
weglTexSubImage1D(*target,*level,*xoffset,*width,*format,*type,pixels);
2103
case 5296: { // glTexSubImage2D
2104
GLenum *target = (GLenum *) bp; bp += 4;
2105
GLint *level = (GLint *) bp; bp += 4;
2106
GLint *xoffset = (GLint *) bp; bp += 4;
2107
GLint *yoffset = (GLint *) bp; bp += 4;
2108
GLsizei *width = (GLsizei *) bp; bp += 4;
2109
GLsizei *height = (GLsizei *) bp; bp += 4;
2110
GLenum *format = (GLenum *) bp; bp += 4;
2111
GLenum *type = (GLenum *) bp; bp += 4;
2112
GLvoid *pixels = (GLvoid *) * (int *) bp; bp += 4;
2113
weglTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*type,pixels);
2115
case 5297: { // glTexSubImage2D
2116
GLenum *target = (GLenum *) bp; bp += 4;
2117
GLint *level = (GLint *) bp; bp += 4;
2118
GLint *xoffset = (GLint *) bp; bp += 4;
2119
GLint *yoffset = (GLint *) bp; bp += 4;
2120
GLsizei *width = (GLsizei *) bp; bp += 4;
2121
GLsizei *height = (GLsizei *) bp; bp += 4;
2122
GLenum *format = (GLenum *) bp; bp += 4;
2123
GLenum *type = (GLenum *) bp; bp += 4;
2124
GLvoid *pixels = (GLvoid *) bins[0];
2125
weglTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*type,pixels);
2127
case 5298: { // glTranslated
2192
2128
GLdouble *x = (GLdouble *) bp; bp += 8;
2193
2129
GLdouble *y = (GLdouble *) bp; bp += 8;
2194
2130
GLdouble *z = (GLdouble *) bp; bp += 8;
2195
2131
weglTranslated(*x,*y,*z);
2197
case 5299: { // glTranslatef
2133
case 5299: { // glTranslatef
2198
2134
GLfloat *x = (GLfloat *) bp; bp += 4;
2199
2135
GLfloat *y = (GLfloat *) bp; bp += 4;
2200
2136
GLfloat *z = (GLfloat *) bp; bp += 4;
2201
2137
weglTranslatef(*x,*y,*z);
2203
case 5300: { // glVertex2dv
2139
case 5300: { // glVertex2dv
2204
2140
GLdouble *v = (GLdouble *) bp; bp += 8;
2205
2141
weglVertex2dv(v);
2207
case 5301: { // glVertex2fv
2143
case 5301: { // glVertex2fv
2208
2144
GLfloat *v = (GLfloat *) bp; bp += 4;
2209
2145
weglVertex2fv(v);
2211
case 5302: { // glVertex2iv
2147
case 5302: { // glVertex2iv
2212
2148
GLint *v = (GLint *) bp; bp += 4;
2213
2149
weglVertex2iv(v);
2215
case 5303: { // glVertex2sv
2151
case 5303: { // glVertex2sv
2216
2152
GLshort *v = (GLshort *) bp; bp += 2;
2217
2153
weglVertex2sv(v);
2219
case 5304: { // glVertex3dv
2155
case 5304: { // glVertex3dv
2220
2156
GLdouble *v = (GLdouble *) bp; bp += 8;
2221
2157
weglVertex3dv(v);
2223
case 5305: { // glVertex3fv
2159
case 5305: { // glVertex3fv
2224
2160
GLfloat *v = (GLfloat *) bp; bp += 4;
2225
2161
weglVertex3fv(v);
2227
case 5306: { // glVertex3iv
2163
case 5306: { // glVertex3iv
2228
2164
GLint *v = (GLint *) bp; bp += 4;
2229
2165
weglVertex3iv(v);
2231
case 5307: { // glVertex3sv
2167
case 5307: { // glVertex3sv
2232
2168
GLshort *v = (GLshort *) bp; bp += 2;
2233
2169
weglVertex3sv(v);
2235
case 5308: { // glVertex4dv
2171
case 5308: { // glVertex4dv
2236
2172
GLdouble *v = (GLdouble *) bp; bp += 8;
2237
2173
weglVertex4dv(v);
2239
case 5309: { // glVertex4fv
2175
case 5309: { // glVertex4fv
2240
2176
GLfloat *v = (GLfloat *) bp; bp += 4;
2241
2177
weglVertex4fv(v);
2243
case 5310: { // glVertex4iv
2179
case 5310: { // glVertex4iv
2244
2180
GLint *v = (GLint *) bp; bp += 4;
2245
2181
weglVertex4iv(v);
2247
case 5311: { // glVertex4sv
2183
case 5311: { // glVertex4sv
2248
2184
GLshort *v = (GLshort *) bp; bp += 2;
2249
2185
weglVertex4sv(v);
2251
case 5312: { // glVertexPointer
2187
case 5312: { // glVertexPointer
2252
2188
GLint *size = (GLint *) bp; bp += 4;
2253
2189
GLenum *type = (GLenum *) bp; bp += 4;
2254
2190
GLsizei *stride = (GLsizei *) bp; bp += 4;
2255
2191
GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4;
2256
2192
weglVertexPointer(*size,*type,*stride,pointer);
2258
case 5313: { // glVertexPointer
2194
case 5313: { // glVertexPointer
2259
2195
GLint *size = (GLint *) bp; bp += 4;
2260
2196
GLenum *type = (GLenum *) bp; bp += 4;
2261
2197
GLsizei *stride = (GLsizei *) bp; bp += 4;
2262
GLvoid *pointer = (GLvoid *) bins[0]->base;
2198
GLvoid *pointer = (GLvoid *) bins[0];
2263
2199
weglVertexPointer(*size,*type,*stride,pointer);
2265
case 5314: { // glViewport
2201
case 5314: { // glViewport
2266
2202
GLint *x = (GLint *) bp; bp += 4;
2267
2203
GLint *y = (GLint *) bp; bp += 4;
2268
2204
GLsizei *width = (GLsizei *) bp; bp += 4;
2269
2205
GLsizei *height = (GLsizei *) bp; bp += 4;
2270
2206
weglViewport(*x,*y,*width,*height);
2272
case 5315: { // glBlendColor
2208
case 5315: { // glBlendColor
2273
2209
GLclampf *red = (GLclampf *) bp; bp += 4;
2274
2210
GLclampf *green = (GLclampf *) bp; bp += 4;
2275
2211
GLclampf *blue = (GLclampf *) bp; bp += 4;
2276
2212
GLclampf *alpha = (GLclampf *) bp; bp += 4;
2277
2213
weglBlendColor(*red,*green,*blue,*alpha);
2279
case 5316: { // glBlendEquation
2215
case 5316: { // glBlendEquation
2280
2216
GLenum *mode = (GLenum *) bp; bp += 4;
2281
2217
weglBlendEquation(*mode);
2283
case 5317: { // glDrawRangeElements
2219
case 5317: { // glDrawRangeElements
2284
2220
GLenum *mode = (GLenum *) bp; bp += 4;
2285
2221
GLuint *start = (GLuint *) bp; bp += 4;
2286
2222
GLuint *end = (GLuint *) bp; bp += 4;
2601
2533
GLvoid *row = (GLvoid *) * (int *) bp; bp += 4;
2602
2534
GLvoid *column = (GLvoid *) * (int *) bp; bp += 4;
2603
2535
weglSeparableFilter2D(*target,*internalformat,*width,*height,*format,*type,row,column);
2605
case 5347: { // glSeparableFilter2D
2537
case 5347: { // glSeparableFilter2D
2606
2538
GLenum *target = (GLenum *) bp; bp += 4;
2607
2539
GLenum *internalformat = (GLenum *) bp; bp += 4;
2608
2540
GLsizei *width = (GLsizei *) bp; bp += 4;
2609
2541
GLsizei *height = (GLsizei *) bp; bp += 4;
2610
2542
GLenum *format = (GLenum *) bp; bp += 4;
2611
2543
GLenum *type = (GLenum *) bp; bp += 4;
2612
GLvoid *row = (GLvoid *) bins[0]->base;
2613
GLvoid *column = (GLvoid *) bins[1]->base;
2544
GLvoid *row = (GLvoid *) bins[0];
2545
GLvoid *column = (GLvoid *) bins[1];
2614
2546
weglSeparableFilter2D(*target,*internalformat,*width,*height,*format,*type,row,column);
2616
case 5348: { // glGetHistogram
2548
case 5348: { // glGetHistogram
2617
2549
GLenum *target = (GLenum *) bp; bp += 4;
2618
2550
GLboolean *reset = (GLboolean *) bp; bp += 1;
2620
2552
GLenum *format = (GLenum *) bp; bp += 4;
2621
2553
GLenum *type = (GLenum *) bp; bp += 4;
2622
GLvoid *values = (GLvoid *) bins[0]->base;
2554
GLvoid *values = (GLvoid *) bins[0];
2623
2555
weglGetHistogram(*target,*reset,*format,*type,values);
2624
2556
int AP = 0; ErlDrvTermData rt[6];
2625
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
2557
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
2626
2558
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
2627
2559
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
2628
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
2630
case 5349: { // glGetHistogramParameterfv
2560
driver_send_term(port,caller,rt,AP);
2562
case 5349: { // glGetHistogramParameterfv
2631
2563
GLenum *target = (GLenum *) bp; bp += 4;
2632
2564
GLenum *pname = (GLenum *) bp; bp += 4;
2633
2565
GLfloat params[1] = {0.0};
2634
2566
weglGetHistogramParameterfv(*target,*pname,params);
2635
2567
int AP = 0; ErlDrvTermData rt[8];
2636
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
2568
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
2637
2569
GLdouble paramsConv[1], *paramsTmp = paramsConv;
2638
2570
for(int i=0; i < 1; i++) paramsConv[i] = (GLdouble) params[i];
2639
2571
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
2640
2572
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 1;
2641
2573
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
2642
if (AP != 8 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,8);
2643
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
2645
case 5350: { // glGetHistogramParameteriv
2574
driver_send_term(port,caller,rt,AP);
2576
case 5350: { // glGetHistogramParameteriv
2646
2577
GLenum *target = (GLenum *) bp; bp += 4;
2647
2578
GLenum *pname = (GLenum *) bp; bp += 4;
2648
2579
GLint params[1] = {0};
2649
2580
weglGetHistogramParameteriv(*target,*pname,params);
2650
2581
int AP = 0; ErlDrvTermData rt[8];
2651
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
2582
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
2652
2583
GLint *paramsTmp = params;
2653
2584
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
2654
2585
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 1;
2655
2586
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
2656
if (AP != 8 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,8);
2657
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
2659
case 5351: { // glGetMinmax
2587
driver_send_term(port,caller,rt,AP);
2589
case 5351: { // glGetMinmax
2660
2590
GLenum *target = (GLenum *) bp; bp += 4;
2661
2591
GLboolean *reset = (GLboolean *) bp; bp += 1;
2663
2593
GLenum *format = (GLenum *) bp; bp += 4;
2664
2594
GLenum *type = (GLenum *) bp; bp += 4;
2665
GLvoid *values = (GLvoid *) bins[0]->base;
2595
GLvoid *values = (GLvoid *) bins[0];
2666
2596
weglGetMinmax(*target,*reset,*format,*type,values);
2667
2597
int AP = 0; ErlDrvTermData rt[6];
2668
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
2598
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
2669
2599
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
2670
2600
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
2671
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
2673
case 5352: { // glGetMinmaxParameterfv
2601
driver_send_term(port,caller,rt,AP);
2603
case 5352: { // glGetMinmaxParameterfv
2674
2604
GLenum *target = (GLenum *) bp; bp += 4;
2675
2605
GLenum *pname = (GLenum *) bp; bp += 4;
2676
2606
GLfloat params[1] = {0.0};
2677
2607
weglGetMinmaxParameterfv(*target,*pname,params);
2678
2608
int AP = 0; ErlDrvTermData rt[8];
2679
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
2609
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
2680
2610
GLdouble paramsConv[1], *paramsTmp = paramsConv;
2681
2611
for(int i=0; i < 1; i++) paramsConv[i] = (GLdouble) params[i];
2682
2612
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
2683
2613
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 1;
2684
2614
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
2685
if (AP != 8 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,8);
2686
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
2688
case 5353: { // glGetMinmaxParameteriv
2615
driver_send_term(port,caller,rt,AP);
2617
case 5353: { // glGetMinmaxParameteriv
2689
2618
GLenum *target = (GLenum *) bp; bp += 4;
2690
2619
GLenum *pname = (GLenum *) bp; bp += 4;
2691
2620
GLint params[1] = {0};
2692
2621
weglGetMinmaxParameteriv(*target,*pname,params);
2693
2622
int AP = 0; ErlDrvTermData rt[8];
2694
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
2623
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
2695
2624
GLint *paramsTmp = params;
2696
2625
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
2697
2626
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 1;
2698
2627
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
2699
if (AP != 8 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,8);
2700
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
2702
case 5354: { // glHistogram
2628
driver_send_term(port,caller,rt,AP);
2630
case 5354: { // glHistogram
2703
2631
GLenum *target = (GLenum *) bp; bp += 4;
2704
2632
GLsizei *width = (GLsizei *) bp; bp += 4;
2705
2633
GLenum *internalformat = (GLenum *) bp; bp += 4;
2706
2634
GLboolean *sink = (GLboolean *) bp; bp += 1;
2707
2635
weglHistogram(*target,*width,*internalformat,*sink);
2709
case 5355: { // glMinmax
2637
case 5355: { // glMinmax
2710
2638
GLenum *target = (GLenum *) bp; bp += 4;
2711
2639
GLenum *internalformat = (GLenum *) bp; bp += 4;
2712
2640
GLboolean *sink = (GLboolean *) bp; bp += 1;
2713
2641
weglMinmax(*target,*internalformat,*sink);
2715
case 5356: { // glResetHistogram
2643
case 5356: { // glResetHistogram
2716
2644
GLenum *target = (GLenum *) bp; bp += 4;
2717
2645
weglResetHistogram(*target);
2719
case 5357: { // glResetMinmax
2647
case 5357: { // glResetMinmax
2720
2648
GLenum *target = (GLenum *) bp; bp += 4;
2721
2649
weglResetMinmax(*target);
2723
case 5358: { // glActiveTexture
2651
case 5358: { // glActiveTexture
2724
2652
GLenum *texture = (GLenum *) bp; bp += 4;
2725
2653
weglActiveTexture(*texture);
2727
case 5359: { // glSampleCoverage
2655
case 5359: { // glSampleCoverage
2728
2656
GLclampf *value = (GLclampf *) bp; bp += 4;
2729
2657
GLboolean *invert = (GLboolean *) bp; bp += 1;
2730
2658
weglSampleCoverage(*value,*invert);
2732
case 5360: { // glCompressedTexImage3D
2733
GLenum *target = (GLenum *) bp; bp += 4;
2734
GLint *level = (GLint *) bp; bp += 4;
2735
GLenum *internalformat = (GLenum *) bp; bp += 4;
2736
GLsizei *width = (GLsizei *) bp; bp += 4;
2737
GLsizei *height = (GLsizei *) bp; bp += 4;
2738
GLsizei *depth = (GLsizei *) bp; bp += 4;
2739
GLint *border = (GLint *) bp; bp += 4;
2740
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2741
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2742
weglCompressedTexImage3D(*target,*level,*internalformat,*width,*height,*depth,*border,*imageSize,data);
2744
case 5361: { // glCompressedTexImage3D
2745
GLenum *target = (GLenum *) bp; bp += 4;
2746
GLint *level = (GLint *) bp; bp += 4;
2747
GLenum *internalformat = (GLenum *) bp; bp += 4;
2748
GLsizei *width = (GLsizei *) bp; bp += 4;
2749
GLsizei *height = (GLsizei *) bp; bp += 4;
2750
GLsizei *depth = (GLsizei *) bp; bp += 4;
2751
GLint *border = (GLint *) bp; bp += 4;
2752
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2753
GLvoid *data = (GLvoid *) bins[0]->base;
2754
weglCompressedTexImage3D(*target,*level,*internalformat,*width,*height,*depth,*border,*imageSize,data);
2756
case 5362: { // glCompressedTexImage2D
2757
GLenum *target = (GLenum *) bp; bp += 4;
2758
GLint *level = (GLint *) bp; bp += 4;
2759
GLenum *internalformat = (GLenum *) bp; bp += 4;
2760
GLsizei *width = (GLsizei *) bp; bp += 4;
2761
GLsizei *height = (GLsizei *) bp; bp += 4;
2762
GLint *border = (GLint *) bp; bp += 4;
2763
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2764
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2765
weglCompressedTexImage2D(*target,*level,*internalformat,*width,*height,*border,*imageSize,data);
2767
case 5363: { // glCompressedTexImage2D
2768
GLenum *target = (GLenum *) bp; bp += 4;
2769
GLint *level = (GLint *) bp; bp += 4;
2770
GLenum *internalformat = (GLenum *) bp; bp += 4;
2771
GLsizei *width = (GLsizei *) bp; bp += 4;
2772
GLsizei *height = (GLsizei *) bp; bp += 4;
2773
GLint *border = (GLint *) bp; bp += 4;
2774
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2775
GLvoid *data = (GLvoid *) bins[0]->base;
2776
weglCompressedTexImage2D(*target,*level,*internalformat,*width,*height,*border,*imageSize,data);
2778
case 5364: { // glCompressedTexImage1D
2779
GLenum *target = (GLenum *) bp; bp += 4;
2780
GLint *level = (GLint *) bp; bp += 4;
2781
GLenum *internalformat = (GLenum *) bp; bp += 4;
2782
GLsizei *width = (GLsizei *) bp; bp += 4;
2783
GLint *border = (GLint *) bp; bp += 4;
2784
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2785
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2786
weglCompressedTexImage1D(*target,*level,*internalformat,*width,*border,*imageSize,data);
2788
case 5365: { // glCompressedTexImage1D
2789
GLenum *target = (GLenum *) bp; bp += 4;
2790
GLint *level = (GLint *) bp; bp += 4;
2791
GLenum *internalformat = (GLenum *) bp; bp += 4;
2792
GLsizei *width = (GLsizei *) bp; bp += 4;
2793
GLint *border = (GLint *) bp; bp += 4;
2794
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2795
GLvoid *data = (GLvoid *) bins[0]->base;
2796
weglCompressedTexImage1D(*target,*level,*internalformat,*width,*border,*imageSize,data);
2798
case 5366: { // glCompressedTexSubImage3D
2799
GLenum *target = (GLenum *) bp; bp += 4;
2800
GLint *level = (GLint *) bp; bp += 4;
2801
GLint *xoffset = (GLint *) bp; bp += 4;
2802
GLint *yoffset = (GLint *) bp; bp += 4;
2803
GLint *zoffset = (GLint *) bp; bp += 4;
2804
GLsizei *width = (GLsizei *) bp; bp += 4;
2805
GLsizei *height = (GLsizei *) bp; bp += 4;
2806
GLsizei *depth = (GLsizei *) bp; bp += 4;
2807
GLenum *format = (GLenum *) bp; bp += 4;
2808
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2809
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2810
weglCompressedTexSubImage3D(*target,*level,*xoffset,*yoffset,*zoffset,*width,*height,*depth,*format,*imageSize,data);
2812
case 5367: { // glCompressedTexSubImage3D
2813
GLenum *target = (GLenum *) bp; bp += 4;
2814
GLint *level = (GLint *) bp; bp += 4;
2815
GLint *xoffset = (GLint *) bp; bp += 4;
2816
GLint *yoffset = (GLint *) bp; bp += 4;
2817
GLint *zoffset = (GLint *) bp; bp += 4;
2818
GLsizei *width = (GLsizei *) bp; bp += 4;
2819
GLsizei *height = (GLsizei *) bp; bp += 4;
2820
GLsizei *depth = (GLsizei *) bp; bp += 4;
2821
GLenum *format = (GLenum *) bp; bp += 4;
2822
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2823
GLvoid *data = (GLvoid *) bins[0]->base;
2824
weglCompressedTexSubImage3D(*target,*level,*xoffset,*yoffset,*zoffset,*width,*height,*depth,*format,*imageSize,data);
2826
case 5368: { // glCompressedTexSubImage2D
2827
GLenum *target = (GLenum *) bp; bp += 4;
2828
GLint *level = (GLint *) bp; bp += 4;
2829
GLint *xoffset = (GLint *) bp; bp += 4;
2830
GLint *yoffset = (GLint *) bp; bp += 4;
2831
GLsizei *width = (GLsizei *) bp; bp += 4;
2832
GLsizei *height = (GLsizei *) bp; bp += 4;
2833
GLenum *format = (GLenum *) bp; bp += 4;
2834
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2835
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2836
weglCompressedTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*imageSize,data);
2838
case 5369: { // glCompressedTexSubImage2D
2839
GLenum *target = (GLenum *) bp; bp += 4;
2840
GLint *level = (GLint *) bp; bp += 4;
2841
GLint *xoffset = (GLint *) bp; bp += 4;
2842
GLint *yoffset = (GLint *) bp; bp += 4;
2843
GLsizei *width = (GLsizei *) bp; bp += 4;
2844
GLsizei *height = (GLsizei *) bp; bp += 4;
2845
GLenum *format = (GLenum *) bp; bp += 4;
2846
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2847
GLvoid *data = (GLvoid *) bins[0]->base;
2848
weglCompressedTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*imageSize,data);
2850
case 5370: { // glCompressedTexSubImage1D
2851
GLenum *target = (GLenum *) bp; bp += 4;
2852
GLint *level = (GLint *) bp; bp += 4;
2853
GLint *xoffset = (GLint *) bp; bp += 4;
2854
GLsizei *width = (GLsizei *) bp; bp += 4;
2855
GLenum *format = (GLenum *) bp; bp += 4;
2856
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2857
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2858
weglCompressedTexSubImage1D(*target,*level,*xoffset,*width,*format,*imageSize,data);
2860
case 5371: { // glCompressedTexSubImage1D
2861
GLenum *target = (GLenum *) bp; bp += 4;
2862
GLint *level = (GLint *) bp; bp += 4;
2863
GLint *xoffset = (GLint *) bp; bp += 4;
2864
GLsizei *width = (GLsizei *) bp; bp += 4;
2865
GLenum *format = (GLenum *) bp; bp += 4;
2866
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2867
GLvoid *data = (GLvoid *) bins[0]->base;
2868
weglCompressedTexSubImage1D(*target,*level,*xoffset,*width,*format,*imageSize,data);
2870
case 5372: { // glGetCompressedTexImage
2871
GLenum *target = (GLenum *) bp; bp += 4;
2872
GLint *level = (GLint *) bp; bp += 4;
2873
GLvoid *img = (GLvoid *) bins[0]->base;
2660
case 5360: { // glCompressedTexImage3D
2661
GLenum *target = (GLenum *) bp; bp += 4;
2662
GLint *level = (GLint *) bp; bp += 4;
2663
GLenum *internalformat = (GLenum *) bp; bp += 4;
2664
GLsizei *width = (GLsizei *) bp; bp += 4;
2665
GLsizei *height = (GLsizei *) bp; bp += 4;
2666
GLsizei *depth = (GLsizei *) bp; bp += 4;
2667
GLint *border = (GLint *) bp; bp += 4;
2668
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2669
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2670
weglCompressedTexImage3D(*target,*level,*internalformat,*width,*height,*depth,*border,*imageSize,data);
2672
case 5361: { // glCompressedTexImage3D
2673
GLenum *target = (GLenum *) bp; bp += 4;
2674
GLint *level = (GLint *) bp; bp += 4;
2675
GLenum *internalformat = (GLenum *) bp; bp += 4;
2676
GLsizei *width = (GLsizei *) bp; bp += 4;
2677
GLsizei *height = (GLsizei *) bp; bp += 4;
2678
GLsizei *depth = (GLsizei *) bp; bp += 4;
2679
GLint *border = (GLint *) bp; bp += 4;
2680
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2681
GLvoid *data = (GLvoid *) bins[0];
2682
weglCompressedTexImage3D(*target,*level,*internalformat,*width,*height,*depth,*border,*imageSize,data);
2684
case 5362: { // glCompressedTexImage2D
2685
GLenum *target = (GLenum *) bp; bp += 4;
2686
GLint *level = (GLint *) bp; bp += 4;
2687
GLenum *internalformat = (GLenum *) bp; bp += 4;
2688
GLsizei *width = (GLsizei *) bp; bp += 4;
2689
GLsizei *height = (GLsizei *) bp; bp += 4;
2690
GLint *border = (GLint *) bp; bp += 4;
2691
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2692
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2693
weglCompressedTexImage2D(*target,*level,*internalformat,*width,*height,*border,*imageSize,data);
2695
case 5363: { // glCompressedTexImage2D
2696
GLenum *target = (GLenum *) bp; bp += 4;
2697
GLint *level = (GLint *) bp; bp += 4;
2698
GLenum *internalformat = (GLenum *) bp; bp += 4;
2699
GLsizei *width = (GLsizei *) bp; bp += 4;
2700
GLsizei *height = (GLsizei *) bp; bp += 4;
2701
GLint *border = (GLint *) bp; bp += 4;
2702
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2703
GLvoid *data = (GLvoid *) bins[0];
2704
weglCompressedTexImage2D(*target,*level,*internalformat,*width,*height,*border,*imageSize,data);
2706
case 5364: { // glCompressedTexImage1D
2707
GLenum *target = (GLenum *) bp; bp += 4;
2708
GLint *level = (GLint *) bp; bp += 4;
2709
GLenum *internalformat = (GLenum *) bp; bp += 4;
2710
GLsizei *width = (GLsizei *) bp; bp += 4;
2711
GLint *border = (GLint *) bp; bp += 4;
2712
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2713
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2714
weglCompressedTexImage1D(*target,*level,*internalformat,*width,*border,*imageSize,data);
2716
case 5365: { // glCompressedTexImage1D
2717
GLenum *target = (GLenum *) bp; bp += 4;
2718
GLint *level = (GLint *) bp; bp += 4;
2719
GLenum *internalformat = (GLenum *) bp; bp += 4;
2720
GLsizei *width = (GLsizei *) bp; bp += 4;
2721
GLint *border = (GLint *) bp; bp += 4;
2722
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2723
GLvoid *data = (GLvoid *) bins[0];
2724
weglCompressedTexImage1D(*target,*level,*internalformat,*width,*border,*imageSize,data);
2726
case 5366: { // glCompressedTexSubImage3D
2727
GLenum *target = (GLenum *) bp; bp += 4;
2728
GLint *level = (GLint *) bp; bp += 4;
2729
GLint *xoffset = (GLint *) bp; bp += 4;
2730
GLint *yoffset = (GLint *) bp; bp += 4;
2731
GLint *zoffset = (GLint *) bp; bp += 4;
2732
GLsizei *width = (GLsizei *) bp; bp += 4;
2733
GLsizei *height = (GLsizei *) bp; bp += 4;
2734
GLsizei *depth = (GLsizei *) bp; bp += 4;
2735
GLenum *format = (GLenum *) bp; bp += 4;
2736
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2737
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2738
weglCompressedTexSubImage3D(*target,*level,*xoffset,*yoffset,*zoffset,*width,*height,*depth,*format,*imageSize,data);
2740
case 5367: { // glCompressedTexSubImage3D
2741
GLenum *target = (GLenum *) bp; bp += 4;
2742
GLint *level = (GLint *) bp; bp += 4;
2743
GLint *xoffset = (GLint *) bp; bp += 4;
2744
GLint *yoffset = (GLint *) bp; bp += 4;
2745
GLint *zoffset = (GLint *) bp; bp += 4;
2746
GLsizei *width = (GLsizei *) bp; bp += 4;
2747
GLsizei *height = (GLsizei *) bp; bp += 4;
2748
GLsizei *depth = (GLsizei *) bp; bp += 4;
2749
GLenum *format = (GLenum *) bp; bp += 4;
2750
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2751
GLvoid *data = (GLvoid *) bins[0];
2752
weglCompressedTexSubImage3D(*target,*level,*xoffset,*yoffset,*zoffset,*width,*height,*depth,*format,*imageSize,data);
2754
case 5368: { // glCompressedTexSubImage2D
2755
GLenum *target = (GLenum *) bp; bp += 4;
2756
GLint *level = (GLint *) bp; bp += 4;
2757
GLint *xoffset = (GLint *) bp; bp += 4;
2758
GLint *yoffset = (GLint *) bp; bp += 4;
2759
GLsizei *width = (GLsizei *) bp; bp += 4;
2760
GLsizei *height = (GLsizei *) bp; bp += 4;
2761
GLenum *format = (GLenum *) bp; bp += 4;
2762
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2763
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2764
weglCompressedTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*imageSize,data);
2766
case 5369: { // glCompressedTexSubImage2D
2767
GLenum *target = (GLenum *) bp; bp += 4;
2768
GLint *level = (GLint *) bp; bp += 4;
2769
GLint *xoffset = (GLint *) bp; bp += 4;
2770
GLint *yoffset = (GLint *) bp; bp += 4;
2771
GLsizei *width = (GLsizei *) bp; bp += 4;
2772
GLsizei *height = (GLsizei *) bp; bp += 4;
2773
GLenum *format = (GLenum *) bp; bp += 4;
2774
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2775
GLvoid *data = (GLvoid *) bins[0];
2776
weglCompressedTexSubImage2D(*target,*level,*xoffset,*yoffset,*width,*height,*format,*imageSize,data);
2778
case 5370: { // glCompressedTexSubImage1D
2779
GLenum *target = (GLenum *) bp; bp += 4;
2780
GLint *level = (GLint *) bp; bp += 4;
2781
GLint *xoffset = (GLint *) bp; bp += 4;
2782
GLsizei *width = (GLsizei *) bp; bp += 4;
2783
GLenum *format = (GLenum *) bp; bp += 4;
2784
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2785
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
2786
weglCompressedTexSubImage1D(*target,*level,*xoffset,*width,*format,*imageSize,data);
2788
case 5371: { // glCompressedTexSubImage1D
2789
GLenum *target = (GLenum *) bp; bp += 4;
2790
GLint *level = (GLint *) bp; bp += 4;
2791
GLint *xoffset = (GLint *) bp; bp += 4;
2792
GLsizei *width = (GLsizei *) bp; bp += 4;
2793
GLenum *format = (GLenum *) bp; bp += 4;
2794
GLsizei *imageSize = (GLsizei *) bp; bp += 4;
2795
GLvoid *data = (GLvoid *) bins[0];
2796
weglCompressedTexSubImage1D(*target,*level,*xoffset,*width,*format,*imageSize,data);
2798
case 5372: { // glGetCompressedTexImage
2799
GLenum *target = (GLenum *) bp; bp += 4;
2800
GLint *level = (GLint *) bp; bp += 4;
2801
GLvoid *img = (GLvoid *) bins[0];
2874
2802
weglGetCompressedTexImage(*target,*level,img);
2875
2803
int AP = 0; ErlDrvTermData rt[6];
2876
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
2804
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
2877
2805
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
2878
2806
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
2879
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
2881
case 5373: { // glClientActiveTexture
2807
driver_send_term(port,caller,rt,AP);
2809
case 5373: { // glClientActiveTexture
2882
2810
GLenum *texture = (GLenum *) bp; bp += 4;
2883
2811
weglClientActiveTexture(*texture);
2885
case 5374: { // glMultiTexCoord1dv
2813
case 5374: { // glMultiTexCoord1dv
2886
2814
GLenum *target = (GLenum *) bp; bp += 4;
2888
2816
GLdouble *v = (GLdouble *) bp; bp += 8;
2889
2817
weglMultiTexCoord1dv(*target,v);
2891
case 5375: { // glMultiTexCoord1fv
2819
case 5375: { // glMultiTexCoord1fv
2892
2820
GLenum *target = (GLenum *) bp; bp += 4;
2893
2821
GLfloat *v = (GLfloat *) bp; bp += 4;
2894
2822
weglMultiTexCoord1fv(*target,v);
2896
case 5376: { // glMultiTexCoord1iv
2824
case 5376: { // glMultiTexCoord1iv
2897
2825
GLenum *target = (GLenum *) bp; bp += 4;
2898
2826
GLint *v = (GLint *) bp; bp += 4;
2899
2827
weglMultiTexCoord1iv(*target,v);
2901
case 5377: { // glMultiTexCoord1sv
2829
case 5377: { // glMultiTexCoord1sv
2902
2830
GLenum *target = (GLenum *) bp; bp += 4;
2903
2831
GLshort *v = (GLshort *) bp; bp += 2;
2904
2832
weglMultiTexCoord1sv(*target,v);
2906
case 5378: { // glMultiTexCoord2dv
2834
case 5378: { // glMultiTexCoord2dv
2907
2835
GLenum *target = (GLenum *) bp; bp += 4;
2909
2837
GLdouble *v = (GLdouble *) bp; bp += 8;
2910
2838
weglMultiTexCoord2dv(*target,v);
2912
case 5379: { // glMultiTexCoord2fv
2840
case 5379: { // glMultiTexCoord2fv
2913
2841
GLenum *target = (GLenum *) bp; bp += 4;
2914
2842
GLfloat *v = (GLfloat *) bp; bp += 4;
2915
2843
weglMultiTexCoord2fv(*target,v);
2917
case 5380: { // glMultiTexCoord2iv
2845
case 5380: { // glMultiTexCoord2iv
2918
2846
GLenum *target = (GLenum *) bp; bp += 4;
2919
2847
GLint *v = (GLint *) bp; bp += 4;
2920
2848
weglMultiTexCoord2iv(*target,v);
2922
case 5381: { // glMultiTexCoord2sv
2850
case 5381: { // glMultiTexCoord2sv
2923
2851
GLenum *target = (GLenum *) bp; bp += 4;
2924
2852
GLshort *v = (GLshort *) bp; bp += 2;
2925
2853
weglMultiTexCoord2sv(*target,v);
2927
case 5382: { // glMultiTexCoord3dv
2855
case 5382: { // glMultiTexCoord3dv
2928
2856
GLenum *target = (GLenum *) bp; bp += 4;
2930
2858
GLdouble *v = (GLdouble *) bp; bp += 8;
2931
2859
weglMultiTexCoord3dv(*target,v);
2933
case 5383: { // glMultiTexCoord3fv
2861
case 5383: { // glMultiTexCoord3fv
2934
2862
GLenum *target = (GLenum *) bp; bp += 4;
2935
2863
GLfloat *v = (GLfloat *) bp; bp += 4;
2936
2864
weglMultiTexCoord3fv(*target,v);
2938
case 5384: { // glMultiTexCoord3iv
2866
case 5384: { // glMultiTexCoord3iv
2939
2867
GLenum *target = (GLenum *) bp; bp += 4;
2940
2868
GLint *v = (GLint *) bp; bp += 4;
2941
2869
weglMultiTexCoord3iv(*target,v);
2943
case 5385: { // glMultiTexCoord3sv
2871
case 5385: { // glMultiTexCoord3sv
2944
2872
GLenum *target = (GLenum *) bp; bp += 4;
2945
2873
GLshort *v = (GLshort *) bp; bp += 2;
2946
2874
weglMultiTexCoord3sv(*target,v);
2948
case 5386: { // glMultiTexCoord4dv
2876
case 5386: { // glMultiTexCoord4dv
2949
2877
GLenum *target = (GLenum *) bp; bp += 4;
2951
2879
GLdouble *v = (GLdouble *) bp; bp += 8;
2952
2880
weglMultiTexCoord4dv(*target,v);
2954
case 5387: { // glMultiTexCoord4fv
2882
case 5387: { // glMultiTexCoord4fv
2955
2883
GLenum *target = (GLenum *) bp; bp += 4;
2956
2884
GLfloat *v = (GLfloat *) bp; bp += 4;
2957
2885
weglMultiTexCoord4fv(*target,v);
2959
case 5388: { // glMultiTexCoord4iv
2887
case 5388: { // glMultiTexCoord4iv
2960
2888
GLenum *target = (GLenum *) bp; bp += 4;
2961
2889
GLint *v = (GLint *) bp; bp += 4;
2962
2890
weglMultiTexCoord4iv(*target,v);
2964
case 5389: { // glMultiTexCoord4sv
2892
case 5389: { // glMultiTexCoord4sv
2965
2893
GLenum *target = (GLenum *) bp; bp += 4;
2966
2894
GLshort *v = (GLshort *) bp; bp += 2;
2967
2895
weglMultiTexCoord4sv(*target,v);
2969
case 5390: { // glLoadTransposeMatrixf
2897
case 5390: { // glLoadTransposeMatrixf
2970
2898
GLfloat * m = (GLfloat *) bp; bp += 64;
2971
2899
weglLoadTransposeMatrixf(m);
2973
case 5391: { // glLoadTransposeMatrixd
2901
case 5391: { // glLoadTransposeMatrixd
2974
2902
GLdouble * m = (GLdouble *) bp; bp += 128;
2975
2903
weglLoadTransposeMatrixd(m);
2977
case 5392: { // glMultTransposeMatrixf
2905
case 5392: { // glMultTransposeMatrixf
2978
2906
GLfloat * m = (GLfloat *) bp; bp += 64;
2979
2907
weglMultTransposeMatrixf(m);
2981
case 5393: { // glMultTransposeMatrixd
2909
case 5393: { // glMultTransposeMatrixd
2982
2910
GLdouble * m = (GLdouble *) bp; bp += 128;
2983
2911
weglMultTransposeMatrixd(m);
2985
case 5394: { // glBlendFuncSeparate
2913
case 5394: { // glBlendFuncSeparate
2986
2914
GLenum *sfactorRGB = (GLenum *) bp; bp += 4;
2987
2915
GLenum *dfactorRGB = (GLenum *) bp; bp += 4;
2988
2916
GLenum *sfactorAlpha = (GLenum *) bp; bp += 4;
2989
2917
GLenum *dfactorAlpha = (GLenum *) bp; bp += 4;
2990
2918
weglBlendFuncSeparate(*sfactorRGB,*dfactorRGB,*sfactorAlpha,*dfactorAlpha);
2992
case 5395: { // glMultiDrawArrays
2920
case 5395: { // glMultiDrawArrays
2993
2921
GLenum *mode = (GLenum *) bp; bp += 4;
2994
2922
int * firstLen = (int *) bp; bp += 4;
2995
2923
GLint * first = (GLint *) bp; bp += (8-((*firstLen*4+0)%8))%8;
2996
2924
int * countLen = (int *) bp; bp += 4;
2997
2925
GLsizei * count = (GLsizei *) bp; bp += (8-((*countLen*4+4)%8))%8;
2998
2926
weglMultiDrawArrays(*mode,first,count,*firstLen);
3000
case 5396: { // glPointParameterf
2928
case 5396: { // glPointParameterf
3001
2929
GLenum *pname = (GLenum *) bp; bp += 4;
3002
2930
GLfloat *param = (GLfloat *) bp; bp += 4;
3003
2931
weglPointParameterf(*pname,*param);
3005
case 5397: { // glPointParameterfv
2933
case 5397: { // glPointParameterfv
3006
2934
GLenum *pname = (GLenum *) bp; bp += 4;
3007
2935
int *paramsLen = (int *) bp; bp += 4;
3008
2936
GLfloat *params = (GLfloat *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
3009
2937
weglPointParameterfv(*pname,params);
3011
case 5398: { // glPointParameteri
2939
case 5398: { // glPointParameteri
3012
2940
GLenum *pname = (GLenum *) bp; bp += 4;
3013
2941
GLint *param = (GLint *) bp; bp += 4;
3014
2942
weglPointParameteri(*pname,*param);
3016
case 5399: { // glPointParameteriv
2944
case 5399: { // glPointParameteriv
3017
2945
GLenum *pname = (GLenum *) bp; bp += 4;
3018
2946
int *paramsLen = (int *) bp; bp += 4;
3019
2947
GLint *params = (GLint *) bp; bp += *paramsLen*4+((*paramsLen)+0)%2*4;
3020
2948
weglPointParameteriv(*pname,params);
3022
case 5400: { // glFogCoordfv
2950
case 5400: { // glFogCoordfv
3023
2951
GLfloat *coord = (GLfloat *) bp; bp += 4;
3024
2952
weglFogCoordfv(coord);
3026
case 5401: { // glFogCoorddv
2954
case 5401: { // glFogCoorddv
3027
2955
GLdouble *coord = (GLdouble *) bp; bp += 8;
3028
2956
weglFogCoorddv(coord);
3030
case 5402: { // glFogCoordPointer
2958
case 5402: { // glFogCoordPointer
3031
2959
GLenum *type = (GLenum *) bp; bp += 4;
3032
2960
GLsizei *stride = (GLsizei *) bp; bp += 4;
3033
2961
GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4;
3034
2962
weglFogCoordPointer(*type,*stride,pointer);
3036
case 5403: { // glFogCoordPointer
2964
case 5403: { // glFogCoordPointer
3037
2965
GLenum *type = (GLenum *) bp; bp += 4;
3038
2966
GLsizei *stride = (GLsizei *) bp; bp += 4;
3039
GLvoid *pointer = (GLvoid *) bins[0]->base;
2967
GLvoid *pointer = (GLvoid *) bins[0];
3040
2968
weglFogCoordPointer(*type,*stride,pointer);
3042
case 5404: { // glSecondaryColor3bv
2970
case 5404: { // glSecondaryColor3bv
3043
2971
GLbyte *v = (GLbyte *) bp; bp += 1;
3044
2972
weglSecondaryColor3bv(v);
3046
case 5405: { // glSecondaryColor3dv
2974
case 5405: { // glSecondaryColor3dv
3047
2975
GLdouble *v = (GLdouble *) bp; bp += 8;
3048
2976
weglSecondaryColor3dv(v);
3050
case 5406: { // glSecondaryColor3fv
2978
case 5406: { // glSecondaryColor3fv
3051
2979
GLfloat *v = (GLfloat *) bp; bp += 4;
3052
2980
weglSecondaryColor3fv(v);
3054
case 5407: { // glSecondaryColor3iv
2982
case 5407: { // glSecondaryColor3iv
3055
2983
GLint *v = (GLint *) bp; bp += 4;
3056
2984
weglSecondaryColor3iv(v);
3058
case 5408: { // glSecondaryColor3sv
2986
case 5408: { // glSecondaryColor3sv
3059
2987
GLshort *v = (GLshort *) bp; bp += 2;
3060
2988
weglSecondaryColor3sv(v);
3062
case 5409: { // glSecondaryColor3ubv
2990
case 5409: { // glSecondaryColor3ubv
3063
2991
GLubyte *v = (GLubyte *) bp; bp += 1;
3064
2992
weglSecondaryColor3ubv(v);
3066
case 5410: { // glSecondaryColor3uiv
2994
case 5410: { // glSecondaryColor3uiv
3067
2995
GLuint *v = (GLuint *) bp; bp += 4;
3068
2996
weglSecondaryColor3uiv(v);
3070
case 5411: { // glSecondaryColor3usv
2998
case 5411: { // glSecondaryColor3usv
3071
2999
GLushort *v = (GLushort *) bp; bp += 2;
3072
3000
weglSecondaryColor3usv(v);
3074
case 5412: { // glSecondaryColorPointer
3002
case 5412: { // glSecondaryColorPointer
3075
3003
GLint *size = (GLint *) bp; bp += 4;
3076
3004
GLenum *type = (GLenum *) bp; bp += 4;
3077
3005
GLsizei *stride = (GLsizei *) bp; bp += 4;
3078
3006
GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4;
3079
3007
weglSecondaryColorPointer(*size,*type,*stride,pointer);
3081
case 5413: { // glSecondaryColorPointer
3009
case 5413: { // glSecondaryColorPointer
3082
3010
GLint *size = (GLint *) bp; bp += 4;
3083
3011
GLenum *type = (GLenum *) bp; bp += 4;
3084
3012
GLsizei *stride = (GLsizei *) bp; bp += 4;
3085
GLvoid *pointer = (GLvoid *) bins[0]->base;
3013
GLvoid *pointer = (GLvoid *) bins[0];
3086
3014
weglSecondaryColorPointer(*size,*type,*stride,pointer);
3088
case 5414: { // glWindowPos2dv
3016
case 5414: { // glWindowPos2dv
3089
3017
GLdouble *v = (GLdouble *) bp; bp += 8;
3090
3018
weglWindowPos2dv(v);
3092
case 5415: { // glWindowPos2fv
3020
case 5415: { // glWindowPos2fv
3093
3021
GLfloat *v = (GLfloat *) bp; bp += 4;
3094
3022
weglWindowPos2fv(v);
3096
case 5416: { // glWindowPos2iv
3024
case 5416: { // glWindowPos2iv
3097
3025
GLint *v = (GLint *) bp; bp += 4;
3098
3026
weglWindowPos2iv(v);
3100
case 5417: { // glWindowPos2sv
3028
case 5417: { // glWindowPos2sv
3101
3029
GLshort *v = (GLshort *) bp; bp += 2;
3102
3030
weglWindowPos2sv(v);
3104
case 5418: { // glWindowPos3dv
3032
case 5418: { // glWindowPos3dv
3105
3033
GLdouble *v = (GLdouble *) bp; bp += 8;
3106
3034
weglWindowPos3dv(v);
3108
case 5419: { // glWindowPos3fv
3036
case 5419: { // glWindowPos3fv
3109
3037
GLfloat *v = (GLfloat *) bp; bp += 4;
3110
3038
weglWindowPos3fv(v);
3112
case 5420: { // glWindowPos3iv
3040
case 5420: { // glWindowPos3iv
3113
3041
GLint *v = (GLint *) bp; bp += 4;
3114
3042
weglWindowPos3iv(v);
3116
case 5421: { // glWindowPos3sv
3044
case 5421: { // glWindowPos3sv
3117
3045
GLshort *v = (GLshort *) bp; bp += 2;
3118
3046
weglWindowPos3sv(v);
3120
case 5422: { // glGenQueries
3048
case 5422: { // glGenQueries
3121
3049
GLsizei *n = (GLsizei *) bp; bp += 4;
3123
3051
ids = (GLuint *) driver_alloc(sizeof(GLuint) * *n);
3124
3052
weglGenQueries(*n,ids);
3125
3053
int AP = 0; ErlDrvTermData *rt;
3126
3054
rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*n)*2));
3127
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3055
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3128
3056
for(int i=0; i < *n; i++) {
3129
3057
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) ids[i];}
3130
3058
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*n)+1;
3131
3059
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3132
if (AP != 7 + (*n)*2 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,7 + (*n)*2);
3133
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3060
driver_send_term(port,caller,rt,AP);
3135
3062
driver_free(ids);
3137
case 5423: { // glDeleteQueries
3064
case 5423: { // glDeleteQueries
3138
3065
int * idsLen = (int *) bp; bp += 4;
3139
3066
GLuint * ids = (GLuint *) bp; bp += (8-((*idsLen*4+4)%8))%8;
3140
3067
weglDeleteQueries(*idsLen,ids);
3142
case 5424: { // glIsQuery
3069
case 5424: { // glIsQuery
3143
3070
GLuint *id = (GLuint *) bp; bp += 4;
3144
3071
GLboolean result = weglIsQuery(*id);
3145
3072
int AP = 0; ErlDrvTermData rt[6];
3146
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3073
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3147
3074
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
3148
3075
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3149
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
3150
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3152
case 5425: { // glBeginQuery
3076
driver_send_term(port,caller,rt,AP);
3078
case 5425: { // glBeginQuery
3153
3079
GLenum *target = (GLenum *) bp; bp += 4;
3154
3080
GLuint *id = (GLuint *) bp; bp += 4;
3155
3081
weglBeginQuery(*target,*id);
3157
case 5426: { // glEndQuery
3083
case 5426: { // glEndQuery
3158
3084
GLenum *target = (GLenum *) bp; bp += 4;
3159
3085
weglEndQuery(*target);
3161
case 5427: { // glGetQueryiv
3087
case 5427: { // glGetQueryiv
3162
3088
GLenum *target = (GLenum *) bp; bp += 4;
3163
3089
GLenum *pname = (GLenum *) bp; bp += 4;
3164
3090
GLint params[1] = {0};
3165
3091
weglGetQueryiv(*target,*pname,params);
3166
3092
int AP = 0; ErlDrvTermData rt[6];
3167
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3093
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3168
3094
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
3169
3095
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3170
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
3171
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3173
case 5428: { // glGetQueryObjectiv
3096
driver_send_term(port,caller,rt,AP);
3098
case 5428: { // glGetQueryObjectiv
3174
3099
GLuint *id = (GLuint *) bp; bp += 4;
3175
3100
GLenum *pname = (GLenum *) bp; bp += 4;
3176
3101
GLint params[1] = {0};
3177
3102
weglGetQueryObjectiv(*id,*pname,params);
3178
3103
int AP = 0; ErlDrvTermData rt[6];
3179
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3104
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3180
3105
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
3181
3106
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3182
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
3183
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3185
case 5429: { // glGetQueryObjectuiv
3107
driver_send_term(port,caller,rt,AP);
3109
case 5429: { // glGetQueryObjectuiv
3186
3110
GLuint *id = (GLuint *) bp; bp += 4;
3187
3111
GLenum *pname = (GLenum *) bp; bp += 4;
3188
3112
GLuint params[1] = {0};
3189
3113
weglGetQueryObjectuiv(*id,*pname,params);
3190
3114
int AP = 0; ErlDrvTermData rt[6];
3191
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3115
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3192
3116
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
3193
3117
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3194
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
3195
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3197
case 5430: { // glBindBuffer
3118
driver_send_term(port,caller,rt,AP);
3120
case 5430: { // glBindBuffer
3198
3121
GLenum *target = (GLenum *) bp; bp += 4;
3199
3122
GLuint *buffer = (GLuint *) bp; bp += 4;
3200
3123
weglBindBuffer(*target,*buffer);
3202
case 5431: { // glDeleteBuffers
3125
case 5431: { // glDeleteBuffers
3203
3126
int * buffersLen = (int *) bp; bp += 4;
3204
3127
GLuint * buffers = (GLuint *) bp; bp += (8-((*buffersLen*4+4)%8))%8;
3205
3128
weglDeleteBuffers(*buffersLen,buffers);
3207
case 5432: { // glGenBuffers
3130
case 5432: { // glGenBuffers
3208
3131
GLsizei *n = (GLsizei *) bp; bp += 4;
3209
3132
GLuint *buffers;
3210
3133
buffers = (GLuint *) driver_alloc(sizeof(GLuint) * *n);
3211
3134
weglGenBuffers(*n,buffers);
3212
3135
int AP = 0; ErlDrvTermData *rt;
3213
3136
rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*n)*2));
3214
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3137
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3215
3138
for(int i=0; i < *n; i++) {
3216
3139
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) buffers[i];}
3217
3140
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*n)+1;
3218
3141
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3219
if (AP != 7 + (*n)*2 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,7 + (*n)*2);
3220
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3142
driver_send_term(port,caller,rt,AP);
3222
3144
driver_free(buffers);
3224
case 5433: { // glIsBuffer
3146
case 5433: { // glIsBuffer
3225
3147
GLuint *buffer = (GLuint *) bp; bp += 4;
3226
3148
GLboolean result = weglIsBuffer(*buffer);
3227
3149
int AP = 0; ErlDrvTermData rt[6];
3228
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3150
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3229
3151
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
3230
3152
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3231
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
3232
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3234
case 5434: { // glBufferData
3235
GLenum *target = (GLenum *) bp; bp += 4;
3237
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3238
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
3239
GLenum *usage = (GLenum *) bp; bp += 4;
3240
weglBufferData(*target,size,data,*usage);
3242
case 5435: { // glBufferData
3243
GLenum *target = (GLenum *) bp; bp += 4;
3245
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3246
GLvoid *data = (GLvoid *) bins[0]->base;
3247
GLenum *usage = (GLenum *) bp; bp += 4;
3248
weglBufferData(*target,size,data,*usage);
3250
case 5436: { // glBufferSubData
3251
GLenum *target = (GLenum *) bp; bp += 4;
3253
GLintptr offset = (GLintptr) * (GLuint64EXT *) bp; bp += 8;
3254
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3255
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
3256
weglBufferSubData(*target,offset,size,data);
3258
case 5437: { // glBufferSubData
3259
GLenum *target = (GLenum *) bp; bp += 4;
3261
GLintptr offset = (GLintptr) * (GLuint64EXT *) bp; bp += 8;
3262
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3263
GLvoid *data = (GLvoid *) bins[0]->base;
3264
weglBufferSubData(*target,offset,size,data);
3266
case 5438: { // glGetBufferSubData
3267
GLenum *target = (GLenum *) bp; bp += 4;
3269
GLintptr offset = (GLintptr) * (GLuint64EXT *) bp; bp += 8;
3270
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3271
GLvoid *data = (GLvoid *) bins[0]->base;
3153
driver_send_term(port,caller,rt,AP);
3155
case 5434: { // glBufferData
3156
GLenum *target = (GLenum *) bp; bp += 4;
3158
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3159
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
3160
GLenum *usage = (GLenum *) bp; bp += 4;
3161
weglBufferData(*target,size,data,*usage);
3163
case 5435: { // glBufferData
3164
GLenum *target = (GLenum *) bp; bp += 4;
3166
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3167
GLvoid *data = (GLvoid *) bins[0];
3168
GLenum *usage = (GLenum *) bp; bp += 4;
3169
weglBufferData(*target,size,data,*usage);
3171
case 5436: { // glBufferSubData
3172
GLenum *target = (GLenum *) bp; bp += 4;
3174
GLintptr offset = (GLintptr) * (GLuint64EXT *) bp; bp += 8;
3175
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3176
GLvoid *data = (GLvoid *) * (int *) bp; bp += 4;
3177
weglBufferSubData(*target,offset,size,data);
3179
case 5437: { // glBufferSubData
3180
GLenum *target = (GLenum *) bp; bp += 4;
3182
GLintptr offset = (GLintptr) * (GLuint64EXT *) bp; bp += 8;
3183
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3184
GLvoid *data = (GLvoid *) bins[0];
3185
weglBufferSubData(*target,offset,size,data);
3187
case 5438: { // glGetBufferSubData
3188
GLenum *target = (GLenum *) bp; bp += 4;
3190
GLintptr offset = (GLintptr) * (GLuint64EXT *) bp; bp += 8;
3191
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
3192
GLvoid *data = (GLvoid *) bins[0];
3272
3193
weglGetBufferSubData(*target,offset,size,data);
3273
3194
int AP = 0; ErlDrvTermData rt[6];
3274
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3195
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3275
3196
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "ok");
3276
3197
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3277
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3279
case 5439: { // glGetBufferParameteriv
3198
driver_send_term(port,caller,rt,AP);
3200
case 5439: { // glGetBufferParameteriv
3280
3201
GLenum *target = (GLenum *) bp; bp += 4;
3281
3202
GLenum *pname = (GLenum *) bp; bp += 4;
3282
3203
GLint params[1] = {0};
3283
3204
weglGetBufferParameteriv(*target,*pname,params);
3284
3205
int AP = 0; ErlDrvTermData rt[6];
3285
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3206
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3286
3207
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
3287
3208
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3288
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
3289
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3291
case 5440: { // glBlendEquationSeparate
3209
driver_send_term(port,caller,rt,AP);
3211
case 5440: { // glBlendEquationSeparate
3292
3212
GLenum *modeRGB = (GLenum *) bp; bp += 4;
3293
3213
GLenum *modeAlpha = (GLenum *) bp; bp += 4;
3294
3214
weglBlendEquationSeparate(*modeRGB,*modeAlpha);
3296
case 5441: { // glDrawBuffers
3216
case 5441: { // glDrawBuffers
3297
3217
int * bufsLen = (int *) bp; bp += 4;
3298
3218
GLenum * bufs = (GLenum *) bp; bp += (8-((*bufsLen*4+4)%8))%8;
3299
3219
weglDrawBuffers(*bufsLen,bufs);
3301
case 5442: { // glStencilOpSeparate
3221
case 5442: { // glStencilOpSeparate
3302
3222
GLenum *face = (GLenum *) bp; bp += 4;
3303
3223
GLenum *sfail = (GLenum *) bp; bp += 4;
3304
3224
GLenum *dpfail = (GLenum *) bp; bp += 4;
3305
3225
GLenum *dppass = (GLenum *) bp; bp += 4;
3306
3226
weglStencilOpSeparate(*face,*sfail,*dpfail,*dppass);
3308
case 5443: { // glStencilFuncSeparate
3309
GLenum *frontfunc = (GLenum *) bp; bp += 4;
3310
GLenum *backfunc = (GLenum *) bp; bp += 4;
3228
case 5443: { // glStencilFuncSeparate
3229
GLenum *face = (GLenum *) bp; bp += 4;
3230
GLenum *func = (GLenum *) bp; bp += 4;
3311
3231
GLint *ref = (GLint *) bp; bp += 4;
3312
3232
GLuint *mask = (GLuint *) bp; bp += 4;
3313
weglStencilFuncSeparate(*frontfunc,*backfunc,*ref,*mask);
3315
case 5444: { // glStencilMaskSeparate
3233
weglStencilFuncSeparate(*face,*func,*ref,*mask);
3235
case 5444: { // glStencilMaskSeparate
3316
3236
GLenum *face = (GLenum *) bp; bp += 4;
3317
3237
GLuint *mask = (GLuint *) bp; bp += 4;
3318
3238
weglStencilMaskSeparate(*face,*mask);
3320
case 5445: { // glAttachShader
3240
case 5445: { // glAttachShader
3321
3241
GLuint *program = (GLuint *) bp; bp += 4;
3322
3242
GLuint *shader = (GLuint *) bp; bp += 4;
3323
3243
weglAttachShader(*program,*shader);
3325
case 5446: { // glBindAttribLocation
3245
case 5446: { // glBindAttribLocation
3326
3246
GLuint *program = (GLuint *) bp; bp += 4;
3327
3247
GLuint *index = (GLuint *) bp; bp += 4;
3328
3248
GLchar *name = (GLchar *) bp;
3329
int nameLen = strlen((char *)name); bp += nameLen+1+((8-((1+nameLen+0)%8))%8);
3249
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+0)%8))%8);
3330
3250
weglBindAttribLocation(*program,*index,name);
3332
case 5447: { // glCompileShader
3252
case 5447: { // glCompileShader
3333
3253
GLuint *shader = (GLuint *) bp; bp += 4;
3334
3254
weglCompileShader(*shader);
3336
case 5448: { // glCreateProgram
3256
case 5448: { // glCreateProgram
3337
3257
GLuint result = weglCreateProgram();
3338
3258
int AP = 0; ErlDrvTermData rt[6];
3339
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3259
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3340
3260
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
3341
3261
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3342
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
3343
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3345
case 5449: { // glCreateShader
3262
driver_send_term(port,caller,rt,AP);
3264
case 5449: { // glCreateShader
3346
3265
GLenum *type = (GLenum *) bp; bp += 4;
3347
3266
GLuint result = weglCreateShader(*type);
3348
3267
int AP = 0; ErlDrvTermData rt[6];
3349
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
3268
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
3350
3269
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
3351
3270
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
3352
if (AP != 6 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,6);
3353
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
3355
case 5450: { // glDeleteProgram
3271
driver_send_term(port,caller,rt,AP);
3273
case 5450: { // glDeleteProgram
3356
3274
GLuint *program = (GLuint *) bp; bp += 4;
3357
3275
weglDeleteProgram(*program);
3359
case 5451: { // glDeleteShader
3277
case 5451: { // glDeleteShader
3360
3278
GLuint *shader = (GLuint *) bp; bp += 4;
3361
3279
weglDeleteShader(*shader);
3363
case 5452: { // glDetachShader
3281
case 5452: { // glDetachShader
3364
3282
GLuint *program = (GLuint *) bp; bp += 4;
3365
3283
GLuint *shader = (GLuint *) bp; bp += 4;
3366
3284
weglDetachShader(*program,*shader);
3368
case 5453: { // glDisableVertexAttribArray
3286
case 5453: { // glDisableVertexAttribArray
3369
3287
GLuint *index = (GLuint *) bp; bp += 4;
3370
3288
weglDisableVertexAttribArray(*index);
3372
case 5454: { // glEnableVertexAttribArray
3290
case 5454: { // glEnableVertexAttribArray
3373
3291
GLuint *index = (GLuint *) bp; bp += 4;
3374
3292
weglEnableVertexAttribArray(*index);
3376
case 5455: { // glGetActiveAttrib
3294
case 5455: { // glGetActiveAttrib
3377
3295
GLuint *program = (GLuint *) bp; bp += 4;
3378
3296
GLuint *index = (GLuint *) bp; bp += 4;
3379
3297
GLsizei *bufSize = (GLsizei *) bp; bp += 4;
4342
4294
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4343
4295
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
4344
4296
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
4345
if (AP != 14 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,14);
4346
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
4348
case 5560: { // glClearBufferiv
4297
driver_send_term(port,caller,rt,AP);
4299
case 5572: { // glClearBufferiv
4349
4300
GLenum *buffer = (GLenum *) bp; bp += 4;
4350
4301
GLint *drawbuffer = (GLint *) bp; bp += 4;
4351
4302
int *valueLen = (int *) bp; bp += 4;
4352
4303
GLint *value = (GLint *) bp; bp += *valueLen*4+((*valueLen)+1)%2*4;
4353
4304
weglClearBufferiv(*buffer,*drawbuffer,value);
4355
case 5561: { // glClearBufferuiv
4306
case 5573: { // glClearBufferuiv
4356
4307
GLenum *buffer = (GLenum *) bp; bp += 4;
4357
4308
GLint *drawbuffer = (GLint *) bp; bp += 4;
4358
4309
int *valueLen = (int *) bp; bp += 4;
4359
4310
GLuint *value = (GLuint *) bp; bp += *valueLen*4+((*valueLen)+1)%2*4;
4360
4311
weglClearBufferuiv(*buffer,*drawbuffer,value);
4362
case 5562: { // glClearBufferfv
4313
case 5574: { // glClearBufferfv
4363
4314
GLenum *buffer = (GLenum *) bp; bp += 4;
4364
4315
GLint *drawbuffer = (GLint *) bp; bp += 4;
4365
4316
int *valueLen = (int *) bp; bp += 4;
4366
4317
GLfloat *value = (GLfloat *) bp; bp += *valueLen*4+((*valueLen)+1)%2*4;
4367
4318
weglClearBufferfv(*buffer,*drawbuffer,value);
4369
case 5563: { // glClearBufferfi
4320
case 5575: { // glClearBufferfi
4370
4321
GLenum *buffer = (GLenum *) bp; bp += 4;
4371
4322
GLint *drawbuffer = (GLint *) bp; bp += 4;
4372
4323
GLfloat *depth = (GLfloat *) bp; bp += 4;
4373
4324
GLint *stencil = (GLint *) bp; bp += 4;
4374
4325
weglClearBufferfi(*buffer,*drawbuffer,*depth,*stencil);
4376
case 5564: { // glGetStringi
4327
case 5576: { // glGetStringi
4377
4328
GLenum *name = (GLenum *) bp; bp += 4;
4378
4329
GLuint *index = (GLuint *) bp; bp += 4;
4379
4330
const GLubyte * result = weglGetStringi(*name,*index);
4380
4331
int AP = 0; ErlDrvTermData rt[7];
4381
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
4332
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
4382
4333
rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) result; rt[AP++] = strlen((char *) result);
4383
4334
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
4384
if (AP != 7 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,7);
4385
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
4387
case 5565: { // glVertexAttribI1iv
4388
GLuint *index = (GLuint *) bp; bp += 4;
4389
GLint *v = (GLint *) bp; bp += 4;
4390
weglVertexAttribI1iv(*index,v);
4392
case 5566: { // glVertexAttribI2iv
4393
GLuint *index = (GLuint *) bp; bp += 4;
4394
GLint *v = (GLint *) bp; bp += 4;
4395
weglVertexAttribI2iv(*index,v);
4397
case 5567: { // glVertexAttribI3iv
4398
GLuint *index = (GLuint *) bp; bp += 4;
4399
GLint *v = (GLint *) bp; bp += 4;
4400
weglVertexAttribI3iv(*index,v);
4402
case 5568: { // glVertexAttribI4iv
4403
GLuint *index = (GLuint *) bp; bp += 4;
4404
GLint * v = (GLint *) bp; bp += 16;
4405
weglVertexAttribI4iv(*index,v);
4407
case 5569: { // glVertexAttribI1uiv
4408
GLuint *index = (GLuint *) bp; bp += 4;
4409
GLuint *v = (GLuint *) bp; bp += 4;
4410
weglVertexAttribI1uiv(*index,v);
4412
case 5570: { // glVertexAttribI2uiv
4413
GLuint *index = (GLuint *) bp; bp += 4;
4414
GLuint *v = (GLuint *) bp; bp += 4;
4415
weglVertexAttribI2uiv(*index,v);
4417
case 5571: { // glVertexAttribI3uiv
4418
GLuint *index = (GLuint *) bp; bp += 4;
4419
GLuint *v = (GLuint *) bp; bp += 4;
4420
weglVertexAttribI3uiv(*index,v);
4422
case 5572: { // glVertexAttribI4uiv
4423
GLuint *index = (GLuint *) bp; bp += 4;
4424
GLuint * v = (GLuint *) bp; bp += 16;
4425
weglVertexAttribI4uiv(*index,v);
4427
case 5573: { // glVertexAttribI4bv
4428
GLuint *index = (GLuint *) bp; bp += 4;
4429
GLbyte * v = (GLbyte *) bp; bp += 4;
4430
weglVertexAttribI4bv(*index,v);
4432
case 5574: { // glVertexAttribI4sv
4433
GLuint *index = (GLuint *) bp; bp += 4;
4434
GLshort * v = (GLshort *) bp; bp += 8;
4435
weglVertexAttribI4sv(*index,v);
4437
case 5575: { // glVertexAttribI4ubv
4438
GLuint *index = (GLuint *) bp; bp += 4;
4439
GLubyte * v = (GLubyte *) bp; bp += 4;
4440
weglVertexAttribI4ubv(*index,v);
4442
case 5576: { // glVertexAttribI4usv
4443
GLuint *index = (GLuint *) bp; bp += 4;
4444
GLushort * v = (GLushort *) bp; bp += 8;
4445
weglVertexAttribI4usv(*index,v);
4447
case 5577: { // glDrawArraysInstanced
4335
driver_send_term(port,caller,rt,AP);
4337
case 5577: { // glDrawArraysInstanced
4448
4338
GLenum *mode = (GLenum *) bp; bp += 4;
4449
4339
GLint *first = (GLint *) bp; bp += 4;
4450
4340
GLsizei *count = (GLsizei *) bp; bp += 4;
4451
4341
GLsizei *primcount = (GLsizei *) bp; bp += 4;
4452
4342
weglDrawArraysInstanced(*mode,*first,*count,*primcount);
4454
case 5578: { // glDrawElementsInstanced
4344
case 5578: { // glDrawElementsInstanced
4455
4345
GLenum *mode = (GLenum *) bp; bp += 4;
4456
4346
GLsizei *count = (GLsizei *) bp; bp += 4;
4457
4347
GLenum *type = (GLenum *) bp; bp += 4;
4458
4348
GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4;
4459
4349
GLsizei *primcount = (GLsizei *) bp; bp += 4;
4460
4350
weglDrawElementsInstanced(*mode,*count,*type,indices,*primcount);
4462
case 5579: { // glDrawElementsInstanced
4352
case 5579: { // glDrawElementsInstanced
4463
4353
GLenum *mode = (GLenum *) bp; bp += 4;
4464
4354
GLsizei *count = (GLsizei *) bp; bp += 4;
4465
4355
GLenum *type = (GLenum *) bp; bp += 4;
4466
GLvoid *indices = (GLvoid *) bins[0]->base;
4356
GLvoid *indices = (GLvoid *) bins[0];
4467
4357
GLsizei *primcount = (GLsizei *) bp; bp += 4;
4468
4358
weglDrawElementsInstanced(*mode,*count,*type,indices,*primcount);
4470
case 5580: { // glTexBuffer
4360
case 5580: { // glTexBuffer
4471
4361
GLenum *target = (GLenum *) bp; bp += 4;
4472
4362
GLenum *internalformat = (GLenum *) bp; bp += 4;
4473
4363
GLuint *buffer = (GLuint *) bp; bp += 4;
4474
4364
weglTexBuffer(*target,*internalformat,*buffer);
4476
case 5581: { // glPrimitiveRestartIndex
4366
case 5581: { // glPrimitiveRestartIndex
4477
4367
GLuint *index = (GLuint *) bp; bp += 4;
4478
4368
weglPrimitiveRestartIndex(*index);
4480
case 5582: { // glLoadTransposeMatrixfARB
4370
case 5582: { // glGetInteger64i_v
4371
GLenum *target = (GLenum *) bp; bp += 4;
4372
GLuint *index = (GLuint *) bp; bp += 4;
4373
GLint64 data[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4374
weglGetInteger64i_v(*target,*index,data);
4375
int AP = 0; ErlDrvTermData rt[39];
4376
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
4377
GLint64 *dataTmp = data;
4378
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4379
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4380
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4381
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4382
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4383
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4384
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4385
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4386
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4387
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4388
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4389
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4390
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4391
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4392
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4393
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *dataTmp++;
4394
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 16+1;
4395
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
4396
driver_send_term(port,caller,rt,AP);
4398
case 5583: { // glGetBufferParameteri64v
4399
GLenum *target = (GLenum *) bp; bp += 4;
4400
GLenum *pname = (GLenum *) bp; bp += 4;
4401
GLint64 params[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4402
weglGetBufferParameteri64v(*target,*pname,params);
4403
int AP = 0; ErlDrvTermData rt[39];
4404
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
4405
GLint64 *paramsTmp = params;
4406
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4407
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4408
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4409
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4410
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4411
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4412
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4413
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4414
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4415
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4416
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4417
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4418
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4419
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4420
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4421
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
4422
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 16+1;
4423
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
4424
driver_send_term(port,caller,rt,AP);
4426
case 5584: { // glFramebufferTexture
4427
GLenum *target = (GLenum *) bp; bp += 4;
4428
GLenum *attachment = (GLenum *) bp; bp += 4;
4429
GLuint *texture = (GLuint *) bp; bp += 4;
4430
GLint *level = (GLint *) bp; bp += 4;
4431
weglFramebufferTexture(*target,*attachment,*texture,*level);
4433
case 5585: { // glVertexAttribDivisor
4434
GLuint *index = (GLuint *) bp; bp += 4;
4435
GLuint *divisor = (GLuint *) bp; bp += 4;
4436
weglVertexAttribDivisor(*index,*divisor);
4438
case 5586: { // glMinSampleShading
4439
GLclampf *value = (GLclampf *) bp; bp += 4;
4440
weglMinSampleShading(*value);
4442
case 5587: { // glBlendEquationi
4443
GLuint *buf = (GLuint *) bp; bp += 4;
4444
GLenum *mode = (GLenum *) bp; bp += 4;
4445
weglBlendEquationi(*buf,*mode);
4447
case 5588: { // glBlendEquationSeparatei
4448
GLuint *buf = (GLuint *) bp; bp += 4;
4449
GLenum *modeRGB = (GLenum *) bp; bp += 4;
4450
GLenum *modeAlpha = (GLenum *) bp; bp += 4;
4451
weglBlendEquationSeparatei(*buf,*modeRGB,*modeAlpha);
4453
case 5589: { // glBlendFunci
4454
GLuint *buf = (GLuint *) bp; bp += 4;
4455
GLenum *src = (GLenum *) bp; bp += 4;
4456
GLenum *dst = (GLenum *) bp; bp += 4;
4457
weglBlendFunci(*buf,*src,*dst);
4459
case 5590: { // glBlendFuncSeparatei
4460
GLuint *buf = (GLuint *) bp; bp += 4;
4461
GLenum *srcRGB = (GLenum *) bp; bp += 4;
4462
GLenum *dstRGB = (GLenum *) bp; bp += 4;
4463
GLenum *srcAlpha = (GLenum *) bp; bp += 4;
4464
GLenum *dstAlpha = (GLenum *) bp; bp += 4;
4465
weglBlendFuncSeparatei(*buf,*srcRGB,*dstRGB,*srcAlpha,*dstAlpha);
4467
case 5591: { // glLoadTransposeMatrixfARB
4481
4468
GLfloat * m = (GLfloat *) bp; bp += 64;
4482
4469
weglLoadTransposeMatrixfARB(m);
4484
case 5583: { // glLoadTransposeMatrixdARB
4471
case 5592: { // glLoadTransposeMatrixdARB
4485
4472
GLdouble * m = (GLdouble *) bp; bp += 128;
4486
4473
weglLoadTransposeMatrixdARB(m);
4488
case 5584: { // glMultTransposeMatrixfARB
4475
case 5593: { // glMultTransposeMatrixfARB
4489
4476
GLfloat * m = (GLfloat *) bp; bp += 64;
4490
4477
weglMultTransposeMatrixfARB(m);
4492
case 5585: { // glMultTransposeMatrixdARB
4479
case 5594: { // glMultTransposeMatrixdARB
4493
4480
GLdouble * m = (GLdouble *) bp; bp += 128;
4494
4481
weglMultTransposeMatrixdARB(m);
4496
case 5586: { // glWeightbvARB
4483
case 5595: { // glWeightbvARB
4497
4484
int * weightsLen = (int *) bp; bp += 4;
4498
4485
GLbyte * weights = (GLbyte *) bp; bp += (8-((*weightsLen*1+4)%8))%8;
4499
4486
weglWeightbvARB(*weightsLen,weights);
4501
case 5587: { // glWeightsvARB
4488
case 5596: { // glWeightsvARB
4502
4489
int * weightsLen = (int *) bp; bp += 4;
4503
4490
GLshort * weights = (GLshort *) bp; bp += (8-((*weightsLen*2+4)%8))%8;
4504
4491
weglWeightsvARB(*weightsLen,weights);
4506
case 5588: { // glWeightivARB
4493
case 5597: { // glWeightivARB
4507
4494
int * weightsLen = (int *) bp; bp += 4;
4508
4495
GLint * weights = (GLint *) bp; bp += (8-((*weightsLen*4+4)%8))%8;
4509
4496
weglWeightivARB(*weightsLen,weights);
4511
case 5589: { // glWeightfvARB
4498
case 5598: { // glWeightfvARB
4512
4499
int * weightsLen = (int *) bp; bp += 4;
4513
4500
GLfloat * weights = (GLfloat *) bp; bp += (8-((*weightsLen*4+4)%8))%8;
4514
4501
weglWeightfvARB(*weightsLen,weights);
4516
case 5590: { // glWeightdvARB
4503
case 5599: { // glWeightdvARB
4517
4504
int * weightsLen = (int *) bp; bp += 8;
4518
4505
GLdouble * weights = (GLdouble *) bp; bp += (8-((*weightsLen*8+0)%8))%8;
4519
4506
weglWeightdvARB(*weightsLen,weights);
4521
case 5591: { // glWeightubvARB
4508
case 5600: { // glWeightubvARB
4522
4509
int * weightsLen = (int *) bp; bp += 4;
4523
4510
GLubyte * weights = (GLubyte *) bp; bp += (8-((*weightsLen*1+4)%8))%8;
4524
4511
weglWeightubvARB(*weightsLen,weights);
4526
case 5592: { // glWeightusvARB
4513
case 5601: { // glWeightusvARB
4527
4514
int * weightsLen = (int *) bp; bp += 4;
4528
4515
GLushort * weights = (GLushort *) bp; bp += (8-((*weightsLen*2+4)%8))%8;
4529
4516
weglWeightusvARB(*weightsLen,weights);
4531
case 5593: { // glWeightuivARB
4518
case 5602: { // glWeightuivARB
4532
4519
int * weightsLen = (int *) bp; bp += 4;
4533
4520
GLuint * weights = (GLuint *) bp; bp += (8-((*weightsLen*4+4)%8))%8;
4534
4521
weglWeightuivARB(*weightsLen,weights);
4536
case 5594: { // glVertexBlendARB
4523
case 5603: { // glVertexBlendARB
4537
4524
GLint *count = (GLint *) bp; bp += 4;
4538
4525
weglVertexBlendARB(*count);
4540
case 5595: { // glCurrentPaletteMatrixARB
4527
case 5604: { // glCurrentPaletteMatrixARB
4541
4528
GLint *index = (GLint *) bp; bp += 4;
4542
4529
weglCurrentPaletteMatrixARB(*index);
4544
case 5596: { // glMatrixIndexubvARB
4531
case 5605: { // glMatrixIndexubvARB
4545
4532
int * indicesLen = (int *) bp; bp += 4;
4546
4533
GLubyte * indices = (GLubyte *) bp; bp += (8-((*indicesLen*1+4)%8))%8;
4547
4534
weglMatrixIndexubvARB(*indicesLen,indices);
4549
case 5597: { // glMatrixIndexusvARB
4536
case 5606: { // glMatrixIndexusvARB
4550
4537
int * indicesLen = (int *) bp; bp += 4;
4551
4538
GLushort * indices = (GLushort *) bp; bp += (8-((*indicesLen*2+4)%8))%8;
4552
4539
weglMatrixIndexusvARB(*indicesLen,indices);
4554
case 5598: { // glMatrixIndexuivARB
4541
case 5607: { // glMatrixIndexuivARB
4555
4542
int * indicesLen = (int *) bp; bp += 4;
4556
4543
GLuint * indices = (GLuint *) bp; bp += (8-((*indicesLen*4+4)%8))%8;
4557
4544
weglMatrixIndexuivARB(*indicesLen,indices);
4559
case 5599: { // glProgramStringARB
4546
case 5608: { // glProgramStringARB
4560
4547
GLenum *target = (GLenum *) bp; bp += 4;
4561
4548
GLenum *format = (GLenum *) bp; bp += 4;
4562
4549
GLvoid *string = (GLvoid *) bp;
4563
int stringLen = strlen((char *)string); bp += stringLen+1+((8-((1+stringLen+0)%8))%8);
4564
weglProgramStringARB(*target,*format,stringLen,string);
4566
case 5600: { // glBindProgramARB
4550
int stringLen[1] = {strlen((char *)string)}; bp += stringLen[0]+1+((8-((1+stringLen[0]+0)%8))%8);
4551
weglProgramStringARB(*target,*format,*stringLen,string);
4553
case 5609: { // glBindProgramARB
4567
4554
GLenum *target = (GLenum *) bp; bp += 4;
4568
4555
GLuint *program = (GLuint *) bp; bp += 4;
4569
4556
weglBindProgramARB(*target,*program);
4571
case 5601: { // glDeleteProgramsARB
4558
case 5610: { // glDeleteProgramsARB
4572
4559
int * programsLen = (int *) bp; bp += 4;
4573
4560
GLuint * programs = (GLuint *) bp; bp += (8-((*programsLen*4+4)%8))%8;
4574
4561
weglDeleteProgramsARB(*programsLen,programs);
4576
case 5602: { // glGenProgramsARB
4563
case 5611: { // glGenProgramsARB
4577
4564
GLsizei *n = (GLsizei *) bp; bp += 4;
4578
4565
GLuint *programs;
4579
4566
programs = (GLuint *) driver_alloc(sizeof(GLuint) * *n);
4580
4567
weglGenProgramsARB(*n,programs);
4581
4568
int AP = 0; ErlDrvTermData *rt;
4582
4569
rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*n)*2));
4583
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
4570
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
4584
4571
for(int i=0; i < *n; i++) {
4585
4572
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) programs[i];}
4586
4573
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*n)+1;
4587
4574
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
4588
if (AP != 7 + (*n)*2 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,7 + (*n)*2);
4589
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
4575
driver_send_term(port,caller,rt,AP);
4591
4577
driver_free(programs);
4593
case 5603: { // glProgramEnvParameter4dARB
4579
case 5612: { // glProgramEnvParameter4dARB
4594
4580
GLenum *target = (GLenum *) bp; bp += 4;
4595
4581
GLuint *index = (GLuint *) bp; bp += 4;
4596
4582
GLdouble *x = (GLdouble *) bp; bp += 8;
5352
5317
uniformBlockName = (GLchar *) driver_alloc(sizeof(GLchar) * *bufSize);
5353
5318
weglGetActiveUniformBlockName(*program,*uniformBlockIndex,*bufSize,length,uniformBlockName);
5354
5319
int AP = 0; ErlDrvTermData rt[7];
5355
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_wxe_result_");
5320
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5356
5321
rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) uniformBlockName; rt[AP++] = *length;
5357
5322
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5358
if (AP != 7 ) fprintf(stderr, "%d: ERROR AP mismatch %d %d\r\n",__LINE__,AP,7);
5359
driver_send_term(WXE_DRV_PORT,caller,rt,AP);
5323
driver_send_term(port,caller,rt,AP);
5360
5324
driver_free(uniformBlockName);
5362
case 5674: { // glUniformBlockBinding
5326
case 5681: { // glUniformBlockBinding
5363
5327
GLuint *program = (GLuint *) bp; bp += 4;
5364
5328
GLuint *uniformBlockIndex = (GLuint *) bp; bp += 4;
5365
5329
GLuint *uniformBlockBinding = (GLuint *) bp; bp += 4;
5366
5330
weglUniformBlockBinding(*program,*uniformBlockIndex,*uniformBlockBinding);
5368
case 5675: { // glCopyBufferSubData
5332
case 5682: { // glCopyBufferSubData
5369
5333
GLenum *readTarget = (GLenum *) bp; bp += 4;
5370
5334
GLenum *writeTarget = (GLenum *) bp; bp += 4;
5371
5335
GLintptr readOffset = (GLintptr) * (GLuint64EXT *) bp; bp += 8;
5372
5336
GLintptr writeOffset = (GLintptr) * (GLuint64EXT *) bp; bp += 8;
5373
5337
GLsizeiptr size = (GLsizeiptr) * (GLuint64EXT *) bp; bp += 8;
5374
5338
weglCopyBufferSubData(*readTarget,*writeTarget,readOffset,writeOffset,size);
5376
case 5676: { // glResizeBuffersMESA
5340
case 5683: { // glDrawElementsBaseVertex
5341
GLenum *mode = (GLenum *) bp; bp += 4;
5342
GLsizei *count = (GLsizei *) bp; bp += 4;
5343
GLenum *type = (GLenum *) bp; bp += 4;
5344
GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4;
5345
GLint *basevertex = (GLint *) bp; bp += 4;
5346
weglDrawElementsBaseVertex(*mode,*count,*type,indices,*basevertex);
5348
case 5684: { // glDrawElementsBaseVertex
5349
GLenum *mode = (GLenum *) bp; bp += 4;
5350
GLsizei *count = (GLsizei *) bp; bp += 4;
5351
GLenum *type = (GLenum *) bp; bp += 4;
5352
GLvoid *indices = (GLvoid *) bins[0];
5353
GLint *basevertex = (GLint *) bp; bp += 4;
5354
weglDrawElementsBaseVertex(*mode,*count,*type,indices,*basevertex);
5356
case 5685: { // glDrawRangeElementsBaseVertex
5357
GLenum *mode = (GLenum *) bp; bp += 4;
5358
GLuint *start = (GLuint *) bp; bp += 4;
5359
GLuint *end = (GLuint *) bp; bp += 4;
5360
GLsizei *count = (GLsizei *) bp; bp += 4;
5361
GLenum *type = (GLenum *) bp; bp += 4;
5362
GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4;
5363
GLint *basevertex = (GLint *) bp; bp += 4;
5364
weglDrawRangeElementsBaseVertex(*mode,*start,*end,*count,*type,indices,*basevertex);
5366
case 5686: { // glDrawRangeElementsBaseVertex
5367
GLenum *mode = (GLenum *) bp; bp += 4;
5368
GLuint *start = (GLuint *) bp; bp += 4;
5369
GLuint *end = (GLuint *) bp; bp += 4;
5370
GLsizei *count = (GLsizei *) bp; bp += 4;
5371
GLenum *type = (GLenum *) bp; bp += 4;
5372
GLvoid *indices = (GLvoid *) bins[0];
5373
GLint *basevertex = (GLint *) bp; bp += 4;
5374
weglDrawRangeElementsBaseVertex(*mode,*start,*end,*count,*type,indices,*basevertex);
5376
case 5687: { // glDrawElementsInstancedBaseVertex
5377
GLenum *mode = (GLenum *) bp; bp += 4;
5378
GLsizei *count = (GLsizei *) bp; bp += 4;
5379
GLenum *type = (GLenum *) bp; bp += 4;
5380
GLvoid *indices = (GLvoid *) * (int *) bp; bp += 4;
5381
GLsizei *primcount = (GLsizei *) bp; bp += 4;
5382
GLint *basevertex = (GLint *) bp; bp += 4;
5383
weglDrawElementsInstancedBaseVertex(*mode,*count,*type,indices,*primcount,*basevertex);
5385
case 5688: { // glDrawElementsInstancedBaseVertex
5386
GLenum *mode = (GLenum *) bp; bp += 4;
5387
GLsizei *count = (GLsizei *) bp; bp += 4;
5388
GLenum *type = (GLenum *) bp; bp += 4;
5389
GLvoid *indices = (GLvoid *) bins[0];
5390
GLsizei *primcount = (GLsizei *) bp; bp += 4;
5391
GLint *basevertex = (GLint *) bp; bp += 4;
5392
weglDrawElementsInstancedBaseVertex(*mode,*count,*type,indices,*primcount,*basevertex);
5394
case 5689: { // glProvokingVertex
5395
GLenum *mode = (GLenum *) bp; bp += 4;
5396
weglProvokingVertex(*mode);
5398
case 5690: { // glFenceSync
5399
GLenum *condition = (GLenum *) bp; bp += 4;
5400
GLbitfield *flags = (GLbitfield *) bp; bp += 4;
5401
GLsync result = weglFenceSync(*condition,*flags);
5402
int AP = 0; ErlDrvTermData rt[6];
5403
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5404
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
5405
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5406
driver_send_term(port,caller,rt,AP);
5408
case 5691: { // glIsSync
5409
GLsync sync = (GLsync) * (GLuint64EXT *) bp; bp += 8;
5410
GLboolean result = weglIsSync(sync);
5411
int AP = 0; ErlDrvTermData rt[6];
5412
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5413
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
5414
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5415
driver_send_term(port,caller,rt,AP);
5417
case 5692: { // glDeleteSync
5418
GLsync sync = (GLsync) * (GLuint64EXT *) bp; bp += 8;
5419
weglDeleteSync(sync);
5421
case 5693: { // glClientWaitSync
5422
GLsync sync = (GLsync) * (GLuint64EXT *) bp; bp += 8;
5423
GLbitfield *flags = (GLbitfield *) bp; bp += 4;
5425
GLuint64 timeout = (GLuint64) * (GLuint64EXT *) bp; bp += 8;
5426
GLenum result = weglClientWaitSync(sync,*flags,timeout);
5427
int AP = 0; ErlDrvTermData rt[6];
5428
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5429
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
5430
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5431
driver_send_term(port,caller,rt,AP);
5433
case 5694: { // glWaitSync
5434
GLsync sync = (GLsync) * (GLuint64EXT *) bp; bp += 8;
5435
GLbitfield *flags = (GLbitfield *) bp; bp += 4;
5437
GLuint64 timeout = (GLuint64) * (GLuint64EXT *) bp; bp += 8;
5438
weglWaitSync(sync,*flags,timeout);
5440
case 5695: { // glGetInteger64v
5441
GLenum *pname = (GLenum *) bp; bp += 4;
5442
GLint64 params[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
5443
weglGetInteger64v(*pname,params);
5444
int AP = 0; ErlDrvTermData rt[39];
5445
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5446
GLint64 *paramsTmp = params;
5447
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5448
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5449
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5450
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5451
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5452
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5453
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5454
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5455
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5456
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5457
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5458
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5459
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5460
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5461
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5462
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5463
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 16+1;
5464
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5465
driver_send_term(port,caller,rt,AP);
5467
case 5696: { // glGetSynciv
5468
GLsync sync = (GLsync) * (GLuint64EXT *) bp; bp += 8;
5469
GLenum *pname = (GLenum *) bp; bp += 4;
5470
GLsizei *bufSize = (GLsizei *) bp; bp += 4;
5471
GLsizei length[1] = {0};
5473
values = (GLint *) driver_alloc(sizeof(GLint) * *bufSize);
5474
weglGetSynciv(sync,*pname,*bufSize,length,values);
5475
int AP = 0; ErlDrvTermData *rt;
5476
rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*length)*2));
5477
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5478
for(int i=0; i < *length; i++) {
5479
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) values[i];}
5480
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*length)+1;
5481
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5482
driver_send_term(port,caller,rt,AP);
5484
driver_free(values);
5486
case 5697: { // glTexImage2DMultisample
5487
GLenum *target = (GLenum *) bp; bp += 4;
5488
GLsizei *samples = (GLsizei *) bp; bp += 4;
5489
GLint *internalformat = (GLint *) bp; bp += 4;
5490
GLsizei *width = (GLsizei *) bp; bp += 4;
5491
GLsizei *height = (GLsizei *) bp; bp += 4;
5492
GLboolean *fixedsamplelocations = (GLboolean *) bp; bp += 1;
5493
weglTexImage2DMultisample(*target,*samples,*internalformat,*width,*height,*fixedsamplelocations);
5495
case 5698: { // glTexImage3DMultisample
5496
GLenum *target = (GLenum *) bp; bp += 4;
5497
GLsizei *samples = (GLsizei *) bp; bp += 4;
5498
GLint *internalformat = (GLint *) bp; bp += 4;
5499
GLsizei *width = (GLsizei *) bp; bp += 4;
5500
GLsizei *height = (GLsizei *) bp; bp += 4;
5501
GLsizei *depth = (GLsizei *) bp; bp += 4;
5502
GLboolean *fixedsamplelocations = (GLboolean *) bp; bp += 1;
5503
weglTexImage3DMultisample(*target,*samples,*internalformat,*width,*height,*depth,*fixedsamplelocations);
5505
case 5699: { // glGetMultisamplefv
5506
GLenum *pname = (GLenum *) bp; bp += 4;
5507
GLuint *index = (GLuint *) bp; bp += 4;
5508
GLfloat val[2] = {0.0,0.0};
5509
weglGetMultisamplefv(*pname,*index,val);
5510
int AP = 0; ErlDrvTermData rt[10];
5511
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5512
GLdouble valConv[2], *valTmp = valConv;
5513
for(int i=0; i < 2; i++) valConv[i] = (GLdouble) val[i];
5514
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) valTmp++;
5515
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) valTmp++;
5516
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5517
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5518
driver_send_term(port,caller,rt,AP);
5520
case 5700: { // glSampleMaski
5521
GLuint *index = (GLuint *) bp; bp += 4;
5522
GLbitfield *mask = (GLbitfield *) bp; bp += 4;
5523
weglSampleMaski(*index,*mask);
5525
case 5701: { // glNamedStringARB
5526
GLenum *type = (GLenum *) bp; bp += 4;
5527
GLchar *name = (GLchar *) bp;
5528
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+4)%8))%8);
5529
GLchar *string = (GLchar *) bp;
5530
int stringLen[1] = {strlen((char *)string)}; bp += stringLen[0]+1+((8-((1+stringLen[0]+0)%8))%8);
5531
weglNamedStringARB(*type,*nameLen,name,*stringLen,string);
5533
case 5702: { // glDeleteNamedStringARB
5534
GLchar *name = (GLchar *) bp;
5535
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+0)%8))%8);
5536
weglDeleteNamedStringARB(*nameLen,name);
5538
case 5703: { // glCompileShaderIncludeARB
5539
GLuint *shader = (GLuint *) bp; bp += 4;
5540
int * pathLen = (int *) bp; bp += 4;
5541
int * pathTotSize = (int *) bp; bp += 4;
5543
path = (GLchar **) driver_alloc(sizeof(GLchar *) * *pathLen);
5544
for(int i=0;i<*pathLen;i++) {
5545
path[i] = (GLchar *) bp; bp += 1+strlen(bp);};
5546
bp += (8 - ((0 + *pathTotSize) % 8)) % 8;
5547
weglCompileShaderIncludeARB(*shader,*pathLen,(const GLchar **) path,NULL);
5550
case 5704: { // glIsNamedStringARB
5551
GLchar *name = (GLchar *) bp;
5552
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+0)%8))%8);
5553
GLboolean result = weglIsNamedStringARB(*nameLen,name);
5554
int AP = 0; ErlDrvTermData rt[6];
5555
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5556
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
5557
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5558
driver_send_term(port,caller,rt,AP);
5560
case 5705: { // glGetNamedStringARB
5561
GLchar *name = (GLchar *) bp;
5562
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+0)%8))%8);
5563
GLsizei *bufSize = (GLsizei *) bp; bp += 4;
5564
GLint stringlen[1] = {0};
5566
string = (GLchar *) driver_alloc(sizeof(GLchar) * *bufSize);
5567
weglGetNamedStringARB(*nameLen,name,*bufSize,stringlen,string);
5568
int AP = 0; ErlDrvTermData rt[7];
5569
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5570
rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) string; rt[AP++] = *stringlen;
5571
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5572
driver_send_term(port,caller,rt,AP);
5573
driver_free(string);
5575
case 5706: { // glGetNamedStringivARB
5576
GLchar *name = (GLchar *) bp;
5577
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+0)%8))%8);
5578
GLenum *pname = (GLenum *) bp; bp += 4;
5579
GLint params[1] = {0};
5580
weglGetNamedStringivARB(*nameLen,name,*pname,params);
5581
int AP = 0; ErlDrvTermData rt[6];
5582
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5583
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
5584
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5585
driver_send_term(port,caller,rt,AP);
5587
case 5707: { // glBindFragDataLocationIndexed
5588
GLuint *program = (GLuint *) bp; bp += 4;
5589
GLuint *colorNumber = (GLuint *) bp; bp += 4;
5590
GLuint *index = (GLuint *) bp; bp += 4;
5591
GLchar *name = (GLchar *) bp;
5592
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+4)%8))%8);
5593
weglBindFragDataLocationIndexed(*program,*colorNumber,*index,name);
5595
case 5708: { // glGetFragDataIndex
5596
GLuint *program = (GLuint *) bp; bp += 4;
5597
GLchar *name = (GLchar *) bp;
5598
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+4)%8))%8);
5599
GLint result = weglGetFragDataIndex(*program,name);
5600
int AP = 0; ErlDrvTermData rt[6];
5601
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5602
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
5603
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5604
driver_send_term(port,caller,rt,AP);
5606
case 5709: { // glGenSamplers
5607
GLsizei *count = (GLsizei *) bp; bp += 4;
5609
samplers = (GLuint *) driver_alloc(sizeof(GLuint) * *count);
5610
weglGenSamplers(*count,samplers);
5611
int AP = 0; ErlDrvTermData *rt;
5612
rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*count)*2));
5613
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5614
for(int i=0; i < *count; i++) {
5615
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) samplers[i];}
5616
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*count)+1;
5617
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5618
driver_send_term(port,caller,rt,AP);
5620
driver_free(samplers);
5622
case 5710: { // glDeleteSamplers
5623
int * samplersLen = (int *) bp; bp += 4;
5624
GLuint * samplers = (GLuint *) bp; bp += (8-((*samplersLen*4+4)%8))%8;
5625
weglDeleteSamplers(*samplersLen,samplers);
5627
case 5711: { // glIsSampler
5628
GLuint *sampler = (GLuint *) bp; bp += 4;
5629
GLboolean result = weglIsSampler(*sampler);
5630
int AP = 0; ErlDrvTermData rt[6];
5631
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5632
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
5633
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5634
driver_send_term(port,caller,rt,AP);
5636
case 5712: { // glBindSampler
5637
GLuint *unit = (GLuint *) bp; bp += 4;
5638
GLuint *sampler = (GLuint *) bp; bp += 4;
5639
weglBindSampler(*unit,*sampler);
5641
case 5713: { // glSamplerParameteri
5642
GLuint *sampler = (GLuint *) bp; bp += 4;
5643
GLenum *pname = (GLenum *) bp; bp += 4;
5644
GLint *param = (GLint *) bp; bp += 4;
5645
weglSamplerParameteri(*sampler,*pname,*param);
5647
case 5714: { // glSamplerParameteriv
5648
GLuint *sampler = (GLuint *) bp; bp += 4;
5649
GLenum *pname = (GLenum *) bp; bp += 4;
5650
int * paramLen = (int *) bp; bp += 4;
5651
GLint * param = (GLint *) bp; bp += (8-((*paramLen*4+4)%8))%8;
5652
weglSamplerParameteriv(*sampler,*pname,param);
5654
case 5715: { // glSamplerParameterf
5655
GLuint *sampler = (GLuint *) bp; bp += 4;
5656
GLenum *pname = (GLenum *) bp; bp += 4;
5657
GLfloat *param = (GLfloat *) bp; bp += 4;
5658
weglSamplerParameterf(*sampler,*pname,*param);
5660
case 5716: { // glSamplerParameterfv
5661
GLuint *sampler = (GLuint *) bp; bp += 4;
5662
GLenum *pname = (GLenum *) bp; bp += 4;
5663
int * paramLen = (int *) bp; bp += 4;
5664
GLfloat * param = (GLfloat *) bp; bp += (8-((*paramLen*4+4)%8))%8;
5665
weglSamplerParameterfv(*sampler,*pname,param);
5667
case 5717: { // glSamplerParameterIiv
5668
GLuint *sampler = (GLuint *) bp; bp += 4;
5669
GLenum *pname = (GLenum *) bp; bp += 4;
5670
int * paramLen = (int *) bp; bp += 4;
5671
GLint * param = (GLint *) bp; bp += (8-((*paramLen*4+4)%8))%8;
5672
weglSamplerParameterIiv(*sampler,*pname,param);
5674
case 5718: { // glSamplerParameterIuiv
5675
GLuint *sampler = (GLuint *) bp; bp += 4;
5676
GLenum *pname = (GLenum *) bp; bp += 4;
5677
int * paramLen = (int *) bp; bp += 4;
5678
GLuint * param = (GLuint *) bp; bp += (8-((*paramLen*4+4)%8))%8;
5679
weglSamplerParameterIuiv(*sampler,*pname,param);
5681
case 5719: { // glGetSamplerParameteriv
5682
GLuint *sampler = (GLuint *) bp; bp += 4;
5683
GLenum *pname = (GLenum *) bp; bp += 4;
5684
GLint params[4] = {0,0,0,0};
5685
weglGetSamplerParameteriv(*sampler,*pname,params);
5686
int AP = 0; ErlDrvTermData rt[15];
5687
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5688
GLint *paramsTmp = params;
5689
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5690
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5691
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5692
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5693
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 4+1;
5694
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5695
driver_send_term(port,caller,rt,AP);
5697
case 5720: { // glGetSamplerParameterIiv
5698
GLuint *sampler = (GLuint *) bp; bp += 4;
5699
GLenum *pname = (GLenum *) bp; bp += 4;
5700
GLint params[4] = {0,0,0,0};
5701
weglGetSamplerParameterIiv(*sampler,*pname,params);
5702
int AP = 0; ErlDrvTermData rt[15];
5703
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5704
GLint *paramsTmp = params;
5705
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5706
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5707
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5708
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5709
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 4+1;
5710
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5711
driver_send_term(port,caller,rt,AP);
5713
case 5721: { // glGetSamplerParameterfv
5714
GLuint *sampler = (GLuint *) bp; bp += 4;
5715
GLenum *pname = (GLenum *) bp; bp += 4;
5716
GLfloat params[4] = {0.0,0.0,0.0,0.0};
5717
weglGetSamplerParameterfv(*sampler,*pname,params);
5718
int AP = 0; ErlDrvTermData rt[15];
5719
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5720
GLdouble paramsConv[4], *paramsTmp = paramsConv;
5721
for(int i=0; i < 4; i++) paramsConv[i] = (GLdouble) params[i];
5722
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5723
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5724
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5725
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5726
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 4+1;
5727
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5728
driver_send_term(port,caller,rt,AP);
5730
case 5722: { // glGetSamplerParameterIuiv
5731
GLuint *sampler = (GLuint *) bp; bp += 4;
5732
GLenum *pname = (GLenum *) bp; bp += 4;
5733
GLuint params[4] = {0,0,0,0};
5734
weglGetSamplerParameterIuiv(*sampler,*pname,params);
5735
int AP = 0; ErlDrvTermData rt[15];
5736
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5737
GLuint *paramsTmp = params;
5738
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5739
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5740
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5741
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
5742
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 4+1;
5743
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5744
driver_send_term(port,caller,rt,AP);
5746
case 5723: { // glQueryCounter
5747
GLuint *id = (GLuint *) bp; bp += 4;
5748
GLenum *target = (GLenum *) bp; bp += 4;
5749
weglQueryCounter(*id,*target);
5751
case 5724: { // glGetQueryObjecti64v
5752
GLuint *id = (GLuint *) bp; bp += 4;
5753
GLenum *pname = (GLenum *) bp; bp += 4;
5754
GLint64 params[1] = {0};
5755
weglGetQueryObjecti64v(*id,*pname,params);
5756
int AP = 0; ErlDrvTermData rt[6];
5757
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5758
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
5759
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5760
driver_send_term(port,caller,rt,AP);
5762
case 5725: { // glGetQueryObjectui64v
5763
GLuint *id = (GLuint *) bp; bp += 4;
5764
GLenum *pname = (GLenum *) bp; bp += 4;
5765
GLuint64 params[1] = {0};
5766
weglGetQueryObjectui64v(*id,*pname,params);
5767
int AP = 0; ErlDrvTermData rt[6];
5768
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5769
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
5770
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5771
driver_send_term(port,caller,rt,AP);
5773
case 5726: { // glDrawArraysIndirect
5774
GLenum *mode = (GLenum *) bp; bp += 4;
5775
GLvoid *indirect = (GLvoid *) * (int *) bp; bp += 4;
5776
weglDrawArraysIndirect(*mode,indirect);
5778
case 5727: { // glDrawArraysIndirect
5779
GLenum *mode = (GLenum *) bp; bp += 4;
5780
GLvoid *indirect = (GLvoid *) bins[0];
5781
weglDrawArraysIndirect(*mode,indirect);
5783
case 5728: { // glDrawElementsIndirect
5784
GLenum *mode = (GLenum *) bp; bp += 4;
5785
GLenum *type = (GLenum *) bp; bp += 4;
5786
GLvoid *indirect = (GLvoid *) * (int *) bp; bp += 4;
5787
weglDrawElementsIndirect(*mode,*type,indirect);
5789
case 5729: { // glDrawElementsIndirect
5790
GLenum *mode = (GLenum *) bp; bp += 4;
5791
GLenum *type = (GLenum *) bp; bp += 4;
5792
GLvoid *indirect = (GLvoid *) bins[0];
5793
weglDrawElementsIndirect(*mode,*type,indirect);
5795
case 5730: { // glUniform1d
5796
GLint *location = (GLint *) bp; bp += 4;
5798
GLdouble *x = (GLdouble *) bp; bp += 8;
5799
weglUniform1d(*location,*x);
5801
case 5731: { // glUniform2d
5802
GLint *location = (GLint *) bp; bp += 4;
5804
GLdouble *x = (GLdouble *) bp; bp += 8;
5805
GLdouble *y = (GLdouble *) bp; bp += 8;
5806
weglUniform2d(*location,*x,*y);
5808
case 5732: { // glUniform3d
5809
GLint *location = (GLint *) bp; bp += 4;
5811
GLdouble *x = (GLdouble *) bp; bp += 8;
5812
GLdouble *y = (GLdouble *) bp; bp += 8;
5813
GLdouble *z = (GLdouble *) bp; bp += 8;
5814
weglUniform3d(*location,*x,*y,*z);
5816
case 5733: { // glUniform4d
5817
GLint *location = (GLint *) bp; bp += 4;
5819
GLdouble *x = (GLdouble *) bp; bp += 8;
5820
GLdouble *y = (GLdouble *) bp; bp += 8;
5821
GLdouble *z = (GLdouble *) bp; bp += 8;
5822
GLdouble *w = (GLdouble *) bp; bp += 8;
5823
weglUniform4d(*location,*x,*y,*z,*w);
5825
case 5734: { // glUniform1dv
5826
GLint *location = (GLint *) bp; bp += 4;
5828
int * valueLen = (int *) bp; bp += 8;
5829
GLdouble * value = (GLdouble *) bp; bp += (8-((*valueLen*8+0)%8))%8;
5830
weglUniform1dv(*location,*valueLen,value);
5832
case 5735: { // glUniform2dv
5833
GLint *location = (GLint *) bp; bp += 4;
5835
int *valueLen = (int *) bp; bp += 8;
5836
GLdouble * value = (GLdouble *) bp; bp += *valueLen*16;
5837
weglUniform2dv(*location,*valueLen,value);
5839
case 5736: { // glUniform3dv
5840
GLint *location = (GLint *) bp; bp += 4;
5842
int *valueLen = (int *) bp; bp += 8;
5843
GLdouble * value = (GLdouble *) bp; bp += *valueLen*24;
5844
weglUniform3dv(*location,*valueLen,value);
5846
case 5737: { // glUniform4dv
5847
GLint *location = (GLint *) bp; bp += 4;
5849
int *valueLen = (int *) bp; bp += 8;
5850
GLdouble * value = (GLdouble *) bp; bp += *valueLen*32;
5851
weglUniform4dv(*location,*valueLen,value);
5853
case 5738: { // glUniformMatrix2dv
5854
GLint *location = (GLint *) bp; bp += 4;
5855
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5857
int *valueLen = (int *) bp; bp += 8;
5858
GLdouble * value = (GLdouble *) bp; bp += *valueLen*32;
5859
weglUniformMatrix2dv(*location,*valueLen,*transpose,value);
5861
case 5739: { // glUniformMatrix3dv
5862
GLint *location = (GLint *) bp; bp += 4;
5863
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5865
int *valueLen = (int *) bp; bp += 8;
5866
GLdouble * value = (GLdouble *) bp; bp += *valueLen*72;
5867
weglUniformMatrix3dv(*location,*valueLen,*transpose,value);
5869
case 5740: { // glUniformMatrix4dv
5870
GLint *location = (GLint *) bp; bp += 4;
5871
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5873
int *valueLen = (int *) bp; bp += 8;
5874
GLdouble * value = (GLdouble *) bp; bp += *valueLen*128;
5875
weglUniformMatrix4dv(*location,*valueLen,*transpose,value);
5877
case 5741: { // glUniformMatrix2x3dv
5878
GLint *location = (GLint *) bp; bp += 4;
5879
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5881
int *valueLen = (int *) bp; bp += 8;
5882
GLdouble * value = (GLdouble *) bp; bp += *valueLen*48;
5883
weglUniformMatrix2x3dv(*location,*valueLen,*transpose,value);
5885
case 5742: { // glUniformMatrix2x4dv
5886
GLint *location = (GLint *) bp; bp += 4;
5887
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5889
int *valueLen = (int *) bp; bp += 8;
5890
GLdouble * value = (GLdouble *) bp; bp += *valueLen*64;
5891
weglUniformMatrix2x4dv(*location,*valueLen,*transpose,value);
5893
case 5743: { // glUniformMatrix3x2dv
5894
GLint *location = (GLint *) bp; bp += 4;
5895
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5897
int *valueLen = (int *) bp; bp += 8;
5898
GLdouble * value = (GLdouble *) bp; bp += *valueLen*48;
5899
weglUniformMatrix3x2dv(*location,*valueLen,*transpose,value);
5901
case 5744: { // glUniformMatrix3x4dv
5902
GLint *location = (GLint *) bp; bp += 4;
5903
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5905
int *valueLen = (int *) bp; bp += 8;
5906
GLdouble * value = (GLdouble *) bp; bp += *valueLen*96;
5907
weglUniformMatrix3x4dv(*location,*valueLen,*transpose,value);
5909
case 5745: { // glUniformMatrix4x2dv
5910
GLint *location = (GLint *) bp; bp += 4;
5911
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5913
int *valueLen = (int *) bp; bp += 8;
5914
GLdouble * value = (GLdouble *) bp; bp += *valueLen*64;
5915
weglUniformMatrix4x2dv(*location,*valueLen,*transpose,value);
5917
case 5746: { // glUniformMatrix4x3dv
5918
GLint *location = (GLint *) bp; bp += 4;
5919
GLboolean *transpose = (GLboolean *) bp; bp += 1;
5921
int *valueLen = (int *) bp; bp += 8;
5922
GLdouble * value = (GLdouble *) bp; bp += *valueLen*96;
5923
weglUniformMatrix4x3dv(*location,*valueLen,*transpose,value);
5925
case 5747: { // glGetUniformdv
5926
GLuint *program = (GLuint *) bp; bp += 4;
5927
GLint *location = (GLint *) bp; bp += 4;
5928
GLdouble params[16] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
5929
weglGetUniformdv(*program,*location,params);
5930
int AP = 0; ErlDrvTermData rt[38];
5931
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5932
GLdouble *paramsTmp = params;
5933
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5934
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5935
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5936
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5937
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5938
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5939
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5940
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5941
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5942
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5943
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5944
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5945
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5946
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5947
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5948
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
5949
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 16;
5950
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5951
driver_send_term(port,caller,rt,AP);
5953
case 5748: { // glGetSubroutineUniformLocation
5954
GLuint *program = (GLuint *) bp; bp += 4;
5955
GLenum *shadertype = (GLenum *) bp; bp += 4;
5956
GLchar *name = (GLchar *) bp;
5957
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+0)%8))%8);
5958
GLint result = weglGetSubroutineUniformLocation(*program,*shadertype,name);
5959
int AP = 0; ErlDrvTermData rt[6];
5960
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5961
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
5962
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5963
driver_send_term(port,caller,rt,AP);
5965
case 5749: { // glGetSubroutineIndex
5966
GLuint *program = (GLuint *) bp; bp += 4;
5967
GLenum *shadertype = (GLenum *) bp; bp += 4;
5968
GLchar *name = (GLchar *) bp;
5969
int nameLen[1] = {strlen((char *)name)}; bp += nameLen[0]+1+((8-((1+nameLen[0]+0)%8))%8);
5970
GLuint result = weglGetSubroutineIndex(*program,*shadertype,name);
5971
int AP = 0; ErlDrvTermData rt[6];
5972
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5973
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
5974
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5975
driver_send_term(port,caller,rt,AP);
5977
case 5750: { // glGetActiveSubroutineUniformName
5978
GLuint *program = (GLuint *) bp; bp += 4;
5979
GLenum *shadertype = (GLenum *) bp; bp += 4;
5980
GLuint *index = (GLuint *) bp; bp += 4;
5981
GLsizei *bufsize = (GLsizei *) bp; bp += 4;
5982
GLsizei length[1] = {0};
5984
name = (GLchar *) driver_alloc(sizeof(GLchar) * *bufsize);
5985
weglGetActiveSubroutineUniformName(*program,*shadertype,*index,*bufsize,length,name);
5986
int AP = 0; ErlDrvTermData rt[7];
5987
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
5988
rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) name; rt[AP++] = *length;
5989
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
5990
driver_send_term(port,caller,rt,AP);
5993
case 5751: { // glGetActiveSubroutineName
5994
GLuint *program = (GLuint *) bp; bp += 4;
5995
GLenum *shadertype = (GLenum *) bp; bp += 4;
5996
GLuint *index = (GLuint *) bp; bp += 4;
5997
GLsizei *bufsize = (GLsizei *) bp; bp += 4;
5998
GLsizei length[1] = {0};
6000
name = (GLchar *) driver_alloc(sizeof(GLchar) * *bufsize);
6001
weglGetActiveSubroutineName(*program,*shadertype,*index,*bufsize,length,name);
6002
int AP = 0; ErlDrvTermData rt[7];
6003
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6004
rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) name; rt[AP++] = *length;
6005
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6006
driver_send_term(port,caller,rt,AP);
6009
case 5752: { // glUniformSubroutinesuiv
6010
GLenum *shadertype = (GLenum *) bp; bp += 4;
6011
int * indicesLen = (int *) bp; bp += 4;
6012
GLuint * indices = (GLuint *) bp; bp += (8-((*indicesLen*4+0)%8))%8;
6013
weglUniformSubroutinesuiv(*shadertype,*indicesLen,indices);
6015
case 5753: { // glGetUniformSubroutineuiv
6016
GLenum *shadertype = (GLenum *) bp; bp += 4;
6017
GLint *location = (GLint *) bp; bp += 4;
6018
GLuint params[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6019
weglGetUniformSubroutineuiv(*shadertype,*location,params);
6020
int AP = 0; ErlDrvTermData rt[38];
6021
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6022
GLuint *paramsTmp = params;
6023
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6024
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6025
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6026
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6027
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6028
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6029
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6030
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6031
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6032
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6033
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6034
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6035
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6036
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6037
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6038
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *paramsTmp++;
6039
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 16;
6040
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6041
driver_send_term(port,caller,rt,AP);
6043
case 5754: { // glGetProgramStageiv
6044
GLuint *program = (GLuint *) bp; bp += 4;
6045
GLenum *shadertype = (GLenum *) bp; bp += 4;
6046
GLenum *pname = (GLenum *) bp; bp += 4;
6047
GLint values[1] = {0};
6048
weglGetProgramStageiv(*program,*shadertype,*pname,values);
6049
int AP = 0; ErlDrvTermData rt[6];
6050
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6051
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *values;
6052
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6053
driver_send_term(port,caller,rt,AP);
6055
case 5755: { // glPatchParameteri
6056
GLenum *pname = (GLenum *) bp; bp += 4;
6057
GLint *value = (GLint *) bp; bp += 4;
6058
weglPatchParameteri(*pname,*value);
6060
case 5756: { // glPatchParameterfv
6061
GLenum *pname = (GLenum *) bp; bp += 4;
6062
int * valuesLen = (int *) bp; bp += 4;
6063
GLfloat * values = (GLfloat *) bp; bp += (8-((*valuesLen*4+0)%8))%8;
6064
weglPatchParameterfv(*pname,values);
6066
case 5757: { // glBindTransformFeedback
6067
GLenum *target = (GLenum *) bp; bp += 4;
6068
GLuint *id = (GLuint *) bp; bp += 4;
6069
weglBindTransformFeedback(*target,*id);
6071
case 5758: { // glDeleteTransformFeedbacks
6072
int * idsLen = (int *) bp; bp += 4;
6073
GLuint * ids = (GLuint *) bp; bp += (8-((*idsLen*4+4)%8))%8;
6074
weglDeleteTransformFeedbacks(*idsLen,ids);
6076
case 5759: { // glGenTransformFeedbacks
6077
GLsizei *n = (GLsizei *) bp; bp += 4;
6079
ids = (GLuint *) driver_alloc(sizeof(GLuint) * *n);
6080
weglGenTransformFeedbacks(*n,ids);
6081
int AP = 0; ErlDrvTermData *rt;
6082
rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*n)*2));
6083
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6084
for(int i=0; i < *n; i++) {
6085
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) ids[i];}
6086
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*n)+1;
6087
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6088
driver_send_term(port,caller,rt,AP);
6092
case 5760: { // glIsTransformFeedback
6093
GLuint *id = (GLuint *) bp; bp += 4;
6094
GLboolean result = weglIsTransformFeedback(*id);
6095
int AP = 0; ErlDrvTermData rt[6];
6096
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6097
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
6098
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6099
driver_send_term(port,caller,rt,AP);
6101
case 5761: { // glPauseTransformFeedback
6102
weglPauseTransformFeedback();
6104
case 5762: { // glResumeTransformFeedback
6105
weglResumeTransformFeedback();
6107
case 5763: { // glDrawTransformFeedback
6108
GLenum *mode = (GLenum *) bp; bp += 4;
6109
GLuint *id = (GLuint *) bp; bp += 4;
6110
weglDrawTransformFeedback(*mode,*id);
6112
case 5764: { // glDrawTransformFeedbackStream
6113
GLenum *mode = (GLenum *) bp; bp += 4;
6114
GLuint *id = (GLuint *) bp; bp += 4;
6115
GLuint *stream = (GLuint *) bp; bp += 4;
6116
weglDrawTransformFeedbackStream(*mode,*id,*stream);
6118
case 5765: { // glBeginQueryIndexed
6119
GLenum *target = (GLenum *) bp; bp += 4;
6120
GLuint *index = (GLuint *) bp; bp += 4;
6121
GLuint *id = (GLuint *) bp; bp += 4;
6122
weglBeginQueryIndexed(*target,*index,*id);
6124
case 5766: { // glEndQueryIndexed
6125
GLenum *target = (GLenum *) bp; bp += 4;
6126
GLuint *index = (GLuint *) bp; bp += 4;
6127
weglEndQueryIndexed(*target,*index);
6129
case 5767: { // glGetQueryIndexediv
6130
GLenum *target = (GLenum *) bp; bp += 4;
6131
GLuint *index = (GLuint *) bp; bp += 4;
6132
GLenum *pname = (GLenum *) bp; bp += 4;
6133
GLint params[1] = {0};
6134
weglGetQueryIndexediv(*target,*index,*pname,params);
6135
int AP = 0; ErlDrvTermData rt[6];
6136
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6137
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
6138
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6139
driver_send_term(port,caller,rt,AP);
6141
case 5768: { // glReleaseShaderCompiler
6142
weglReleaseShaderCompiler();
6144
case 5769: { // glShaderBinary
6145
int * shadersLen = (int *) bp; bp += 4;
6146
GLuint * shaders = (GLuint *) bp; bp += (8-((*shadersLen*4+4)%8))%8;
6147
GLenum *binaryformat = (GLenum *) bp; bp += 4;
6148
GLvoid *binary = (GLvoid *) bins[0];
6149
GLsizei binary_size = bins_sz[0];
6150
weglShaderBinary(*shadersLen,shaders,*binaryformat,binary,binary_size);
6152
case 5770: { // glGetShaderPrecisionFormat
6153
GLenum *shadertype = (GLenum *) bp; bp += 4;
6154
GLenum *precisiontype = (GLenum *) bp; bp += 4;
6155
GLint range[2] = {0,0};
6156
GLint precision[1] = {0};
6157
weglGetShaderPrecisionFormat(*shadertype,*precisiontype,range,precision);
6158
int AP = 0; ErlDrvTermData rt[14];
6159
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6160
GLint *rangeTmp = range;
6161
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *rangeTmp++;
6162
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *rangeTmp++;
6163
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6164
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *precision;
6165
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6166
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6167
driver_send_term(port,caller,rt,AP);
6169
case 5771: { // glDepthRangef
6170
GLclampf *n = (GLclampf *) bp; bp += 4;
6171
GLclampf *f = (GLclampf *) bp; bp += 4;
6172
weglDepthRangef(*n,*f);
6174
case 5772: { // glClearDepthf
6175
GLclampf *d = (GLclampf *) bp; bp += 4;
6176
weglClearDepthf(*d);
6178
case 5773: { // glGetProgramBinary
6179
GLuint *program = (GLuint *) bp; bp += 4;
6180
GLsizei *bufSize = (GLsizei *) bp; bp += 4;
6181
GLsizei length[1] = {0};
6182
GLenum binaryFormat[1] = {0};
6183
ErlDrvBinary *binary = driver_alloc_binary(*bufSize);
6184
weglGetProgramBinary(*program,*bufSize,length,binaryFormat,(GLvoid*) binary->orig_bytes);
6185
int AP = 0; ErlDrvTermData rt[12];
6186
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6187
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *binaryFormat;
6188
rt[AP++] = ERL_DRV_BINARY; rt[AP++] = (ErlDrvTermData) binary; rt[AP++] = *length; rt[AP++] = 0;
6189
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6190
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6191
driver_send_term(port,caller,rt,AP);
6192
driver_free_binary(binary);
6194
case 5774: { // glProgramBinary
6195
GLuint *program = (GLuint *) bp; bp += 4;
6196
GLenum *binaryFormat = (GLenum *) bp; bp += 4;
6197
GLvoid *binary = (GLvoid *) bins[0];
6198
GLsizei binary_size = bins_sz[0];
6199
weglProgramBinary(*program,*binaryFormat,binary,binary_size);
6201
case 5775: { // glProgramParameteri
6202
GLuint *program = (GLuint *) bp; bp += 4;
6203
GLenum *pname = (GLenum *) bp; bp += 4;
6204
GLint *value = (GLint *) bp; bp += 4;
6205
weglProgramParameteri(*program,*pname,*value);
6207
case 5776: { // glUseProgramStages
6208
GLuint *pipeline = (GLuint *) bp; bp += 4;
6209
GLbitfield *stages = (GLbitfield *) bp; bp += 4;
6210
GLuint *program = (GLuint *) bp; bp += 4;
6211
weglUseProgramStages(*pipeline,*stages,*program);
6213
case 5777: { // glActiveShaderProgram
6214
GLuint *pipeline = (GLuint *) bp; bp += 4;
6215
GLuint *program = (GLuint *) bp; bp += 4;
6216
weglActiveShaderProgram(*pipeline,*program);
6218
case 5778: { // glCreateShaderProgramv
6219
GLenum *type = (GLenum *) bp; bp += 4;
6220
int * stringsLen = (int *) bp; bp += 4;
6221
int * stringsTotSize = (int *) bp; bp += 4;
6223
strings = (GLchar **) driver_alloc(sizeof(GLchar *) * *stringsLen);
6224
for(int i=0;i<*stringsLen;i++) {
6225
strings[i] = (GLchar *) bp; bp += 1+strlen(bp);};
6226
bp += (8 - ((0 + *stringsTotSize) % 8)) % 8;
6227
GLuint result = weglCreateShaderProgramv(*type,*stringsLen,(const GLchar **) strings);
6228
int AP = 0; ErlDrvTermData rt[6];
6229
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6230
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
6231
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6232
driver_send_term(port,caller,rt,AP);
6233
driver_free(strings);
6235
case 5779: { // glBindProgramPipeline
6236
GLuint *pipeline = (GLuint *) bp; bp += 4;
6237
weglBindProgramPipeline(*pipeline);
6239
case 5780: { // glDeleteProgramPipelines
6240
int * pipelinesLen = (int *) bp; bp += 4;
6241
GLuint * pipelines = (GLuint *) bp; bp += (8-((*pipelinesLen*4+4)%8))%8;
6242
weglDeleteProgramPipelines(*pipelinesLen,pipelines);
6244
case 5781: { // glGenProgramPipelines
6245
GLsizei *n = (GLsizei *) bp; bp += 4;
6247
pipelines = (GLuint *) driver_alloc(sizeof(GLuint) * *n);
6248
weglGenProgramPipelines(*n,pipelines);
6249
int AP = 0; ErlDrvTermData *rt;
6250
rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(7 + (*n)*2));
6251
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6252
for(int i=0; i < *n; i++) {
6253
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) pipelines[i];}
6254
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = (*n)+1;
6255
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6256
driver_send_term(port,caller,rt,AP);
6258
driver_free(pipelines);
6260
case 5782: { // glIsProgramPipeline
6261
GLuint *pipeline = (GLuint *) bp; bp += 4;
6262
GLboolean result = weglIsProgramPipeline(*pipeline);
6263
int AP = 0; ErlDrvTermData rt[6];
6264
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6265
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
6266
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6267
driver_send_term(port,caller,rt,AP);
6269
case 5783: { // glGetProgramPipelineiv
6270
GLuint *pipeline = (GLuint *) bp; bp += 4;
6271
GLenum *pname = (GLenum *) bp; bp += 4;
6272
GLint params[1] = {0};
6273
weglGetProgramPipelineiv(*pipeline,*pname,params);
6274
int AP = 0; ErlDrvTermData rt[6];
6275
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6276
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) *params;
6277
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6278
driver_send_term(port,caller,rt,AP);
6280
case 5784: { // glProgramUniform1i
6281
GLuint *program = (GLuint *) bp; bp += 4;
6282
GLint *location = (GLint *) bp; bp += 4;
6283
GLint *v0 = (GLint *) bp; bp += 4;
6284
weglProgramUniform1i(*program,*location,*v0);
6286
case 5785: { // glProgramUniform1iv
6287
GLuint *program = (GLuint *) bp; bp += 4;
6288
GLint *location = (GLint *) bp; bp += 4;
6289
int * valueLen = (int *) bp; bp += 4;
6290
GLint * value = (GLint *) bp; bp += (8-((*valueLen*4+4)%8))%8;
6291
weglProgramUniform1iv(*program,*location,*valueLen,value);
6293
case 5786: { // glProgramUniform1f
6294
GLuint *program = (GLuint *) bp; bp += 4;
6295
GLint *location = (GLint *) bp; bp += 4;
6296
GLfloat *v0 = (GLfloat *) bp; bp += 4;
6297
weglProgramUniform1f(*program,*location,*v0);
6299
case 5787: { // glProgramUniform1fv
6300
GLuint *program = (GLuint *) bp; bp += 4;
6301
GLint *location = (GLint *) bp; bp += 4;
6302
int * valueLen = (int *) bp; bp += 4;
6303
GLfloat * value = (GLfloat *) bp; bp += (8-((*valueLen*4+4)%8))%8;
6304
weglProgramUniform1fv(*program,*location,*valueLen,value);
6306
case 5788: { // glProgramUniform1d
6307
GLuint *program = (GLuint *) bp; bp += 4;
6308
GLint *location = (GLint *) bp; bp += 4;
6309
GLdouble *v0 = (GLdouble *) bp; bp += 8;
6310
weglProgramUniform1d(*program,*location,*v0);
6312
case 5789: { // glProgramUniform1dv
6313
GLuint *program = (GLuint *) bp; bp += 4;
6314
GLint *location = (GLint *) bp; bp += 4;
6315
int * valueLen = (int *) bp; bp += 8;
6316
GLdouble * value = (GLdouble *) bp; bp += (8-((*valueLen*8+0)%8))%8;
6317
weglProgramUniform1dv(*program,*location,*valueLen,value);
6319
case 5790: { // glProgramUniform1ui
6320
GLuint *program = (GLuint *) bp; bp += 4;
6321
GLint *location = (GLint *) bp; bp += 4;
6322
GLuint *v0 = (GLuint *) bp; bp += 4;
6323
weglProgramUniform1ui(*program,*location,*v0);
6325
case 5791: { // glProgramUniform1uiv
6326
GLuint *program = (GLuint *) bp; bp += 4;
6327
GLint *location = (GLint *) bp; bp += 4;
6328
int * valueLen = (int *) bp; bp += 4;
6329
GLuint * value = (GLuint *) bp; bp += (8-((*valueLen*4+4)%8))%8;
6330
weglProgramUniform1uiv(*program,*location,*valueLen,value);
6332
case 5792: { // glProgramUniform2i
6333
GLuint *program = (GLuint *) bp; bp += 4;
6334
GLint *location = (GLint *) bp; bp += 4;
6335
GLint *v0 = (GLint *) bp; bp += 4;
6336
GLint *v1 = (GLint *) bp; bp += 4;
6337
weglProgramUniform2i(*program,*location,*v0,*v1);
6339
case 5793: { // glProgramUniform2iv
6340
GLuint *program = (GLuint *) bp; bp += 4;
6341
GLint *location = (GLint *) bp; bp += 4;
6342
int *valueLen = (int *) bp; bp += 4;
6343
GLint * value = (GLint *) bp; bp += *valueLen*8;
6344
weglProgramUniform2iv(*program,*location,*valueLen,value);
6346
case 5794: { // glProgramUniform2f
6347
GLuint *program = (GLuint *) bp; bp += 4;
6348
GLint *location = (GLint *) bp; bp += 4;
6349
GLfloat *v0 = (GLfloat *) bp; bp += 4;
6350
GLfloat *v1 = (GLfloat *) bp; bp += 4;
6351
weglProgramUniform2f(*program,*location,*v0,*v1);
6353
case 5795: { // glProgramUniform2fv
6354
GLuint *program = (GLuint *) bp; bp += 4;
6355
GLint *location = (GLint *) bp; bp += 4;
6356
int *valueLen = (int *) bp; bp += 4;
6357
GLfloat * value = (GLfloat *) bp; bp += *valueLen*8;
6358
weglProgramUniform2fv(*program,*location,*valueLen,value);
6360
case 5796: { // glProgramUniform2d
6361
GLuint *program = (GLuint *) bp; bp += 4;
6362
GLint *location = (GLint *) bp; bp += 4;
6363
GLdouble *v0 = (GLdouble *) bp; bp += 8;
6364
GLdouble *v1 = (GLdouble *) bp; bp += 8;
6365
weglProgramUniform2d(*program,*location,*v0,*v1);
6367
case 5797: { // glProgramUniform2dv
6368
GLuint *program = (GLuint *) bp; bp += 4;
6369
GLint *location = (GLint *) bp; bp += 4;
6370
int *valueLen = (int *) bp; bp += 8;
6371
GLdouble * value = (GLdouble *) bp; bp += *valueLen*16;
6372
weglProgramUniform2dv(*program,*location,*valueLen,value);
6374
case 5798: { // glProgramUniform2ui
6375
GLuint *program = (GLuint *) bp; bp += 4;
6376
GLint *location = (GLint *) bp; bp += 4;
6377
GLuint *v0 = (GLuint *) bp; bp += 4;
6378
GLuint *v1 = (GLuint *) bp; bp += 4;
6379
weglProgramUniform2ui(*program,*location,*v0,*v1);
6381
case 5799: { // glProgramUniform2uiv
6382
GLuint *program = (GLuint *) bp; bp += 4;
6383
GLint *location = (GLint *) bp; bp += 4;
6384
int *valueLen = (int *) bp; bp += 4;
6385
GLuint * value = (GLuint *) bp; bp += *valueLen*8;
6386
weglProgramUniform2uiv(*program,*location,*valueLen,value);
6388
case 5800: { // glProgramUniform3i
6389
GLuint *program = (GLuint *) bp; bp += 4;
6390
GLint *location = (GLint *) bp; bp += 4;
6391
GLint *v0 = (GLint *) bp; bp += 4;
6392
GLint *v1 = (GLint *) bp; bp += 4;
6393
GLint *v2 = (GLint *) bp; bp += 4;
6394
weglProgramUniform3i(*program,*location,*v0,*v1,*v2);
6396
case 5801: { // glProgramUniform3iv
6397
GLuint *program = (GLuint *) bp; bp += 4;
6398
GLint *location = (GLint *) bp; bp += 4;
6399
int *valueLen = (int *) bp; bp += 4;
6400
GLint * value = (GLint *) bp; bp += *valueLen*12;
6401
weglProgramUniform3iv(*program,*location,*valueLen,value);
6403
case 5802: { // glProgramUniform3f
6404
GLuint *program = (GLuint *) bp; bp += 4;
6405
GLint *location = (GLint *) bp; bp += 4;
6406
GLfloat *v0 = (GLfloat *) bp; bp += 4;
6407
GLfloat *v1 = (GLfloat *) bp; bp += 4;
6408
GLfloat *v2 = (GLfloat *) bp; bp += 4;
6409
weglProgramUniform3f(*program,*location,*v0,*v1,*v2);
6411
case 5803: { // glProgramUniform3fv
6412
GLuint *program = (GLuint *) bp; bp += 4;
6413
GLint *location = (GLint *) bp; bp += 4;
6414
int *valueLen = (int *) bp; bp += 4;
6415
GLfloat * value = (GLfloat *) bp; bp += *valueLen*12;
6416
weglProgramUniform3fv(*program,*location,*valueLen,value);
6418
case 5804: { // glProgramUniform3d
6419
GLuint *program = (GLuint *) bp; bp += 4;
6420
GLint *location = (GLint *) bp; bp += 4;
6421
GLdouble *v0 = (GLdouble *) bp; bp += 8;
6422
GLdouble *v1 = (GLdouble *) bp; bp += 8;
6423
GLdouble *v2 = (GLdouble *) bp; bp += 8;
6424
weglProgramUniform3d(*program,*location,*v0,*v1,*v2);
6426
case 5805: { // glProgramUniform3dv
6427
GLuint *program = (GLuint *) bp; bp += 4;
6428
GLint *location = (GLint *) bp; bp += 4;
6429
int *valueLen = (int *) bp; bp += 8;
6430
GLdouble * value = (GLdouble *) bp; bp += *valueLen*24;
6431
weglProgramUniform3dv(*program,*location,*valueLen,value);
6433
case 5806: { // glProgramUniform3ui
6434
GLuint *program = (GLuint *) bp; bp += 4;
6435
GLint *location = (GLint *) bp; bp += 4;
6436
GLuint *v0 = (GLuint *) bp; bp += 4;
6437
GLuint *v1 = (GLuint *) bp; bp += 4;
6438
GLuint *v2 = (GLuint *) bp; bp += 4;
6439
weglProgramUniform3ui(*program,*location,*v0,*v1,*v2);
6441
case 5807: { // glProgramUniform3uiv
6442
GLuint *program = (GLuint *) bp; bp += 4;
6443
GLint *location = (GLint *) bp; bp += 4;
6444
int *valueLen = (int *) bp; bp += 4;
6445
GLuint * value = (GLuint *) bp; bp += *valueLen*12;
6446
weglProgramUniform3uiv(*program,*location,*valueLen,value);
6448
case 5808: { // glProgramUniform4i
6449
GLuint *program = (GLuint *) bp; bp += 4;
6450
GLint *location = (GLint *) bp; bp += 4;
6451
GLint *v0 = (GLint *) bp; bp += 4;
6452
GLint *v1 = (GLint *) bp; bp += 4;
6453
GLint *v2 = (GLint *) bp; bp += 4;
6454
GLint *v3 = (GLint *) bp; bp += 4;
6455
weglProgramUniform4i(*program,*location,*v0,*v1,*v2,*v3);
6457
case 5809: { // glProgramUniform4iv
6458
GLuint *program = (GLuint *) bp; bp += 4;
6459
GLint *location = (GLint *) bp; bp += 4;
6460
int *valueLen = (int *) bp; bp += 4;
6461
GLint * value = (GLint *) bp; bp += *valueLen*16;
6462
weglProgramUniform4iv(*program,*location,*valueLen,value);
6464
case 5810: { // glProgramUniform4f
6465
GLuint *program = (GLuint *) bp; bp += 4;
6466
GLint *location = (GLint *) bp; bp += 4;
6467
GLfloat *v0 = (GLfloat *) bp; bp += 4;
6468
GLfloat *v1 = (GLfloat *) bp; bp += 4;
6469
GLfloat *v2 = (GLfloat *) bp; bp += 4;
6470
GLfloat *v3 = (GLfloat *) bp; bp += 4;
6471
weglProgramUniform4f(*program,*location,*v0,*v1,*v2,*v3);
6473
case 5811: { // glProgramUniform4fv
6474
GLuint *program = (GLuint *) bp; bp += 4;
6475
GLint *location = (GLint *) bp; bp += 4;
6476
int *valueLen = (int *) bp; bp += 4;
6477
GLfloat * value = (GLfloat *) bp; bp += *valueLen*16;
6478
weglProgramUniform4fv(*program,*location,*valueLen,value);
6480
case 5812: { // glProgramUniform4d
6481
GLuint *program = (GLuint *) bp; bp += 4;
6482
GLint *location = (GLint *) bp; bp += 4;
6483
GLdouble *v0 = (GLdouble *) bp; bp += 8;
6484
GLdouble *v1 = (GLdouble *) bp; bp += 8;
6485
GLdouble *v2 = (GLdouble *) bp; bp += 8;
6486
GLdouble *v3 = (GLdouble *) bp; bp += 8;
6487
weglProgramUniform4d(*program,*location,*v0,*v1,*v2,*v3);
6489
case 5813: { // glProgramUniform4dv
6490
GLuint *program = (GLuint *) bp; bp += 4;
6491
GLint *location = (GLint *) bp; bp += 4;
6492
int *valueLen = (int *) bp; bp += 8;
6493
GLdouble * value = (GLdouble *) bp; bp += *valueLen*32;
6494
weglProgramUniform4dv(*program,*location,*valueLen,value);
6496
case 5814: { // glProgramUniform4ui
6497
GLuint *program = (GLuint *) bp; bp += 4;
6498
GLint *location = (GLint *) bp; bp += 4;
6499
GLuint *v0 = (GLuint *) bp; bp += 4;
6500
GLuint *v1 = (GLuint *) bp; bp += 4;
6501
GLuint *v2 = (GLuint *) bp; bp += 4;
6502
GLuint *v3 = (GLuint *) bp; bp += 4;
6503
weglProgramUniform4ui(*program,*location,*v0,*v1,*v2,*v3);
6505
case 5815: { // glProgramUniform4uiv
6506
GLuint *program = (GLuint *) bp; bp += 4;
6507
GLint *location = (GLint *) bp; bp += 4;
6508
int *valueLen = (int *) bp; bp += 4;
6509
GLuint * value = (GLuint *) bp; bp += *valueLen*16;
6510
weglProgramUniform4uiv(*program,*location,*valueLen,value);
6512
case 5816: { // glProgramUniformMatrix2fv
6513
GLuint *program = (GLuint *) bp; bp += 4;
6514
GLint *location = (GLint *) bp; bp += 4;
6515
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6517
int *valueLen = (int *) bp; bp += 4;
6518
GLfloat * value = (GLfloat *) bp; bp += *valueLen*16;
6519
weglProgramUniformMatrix2fv(*program,*location,*valueLen,*transpose,value);
6521
case 5817: { // glProgramUniformMatrix3fv
6522
GLuint *program = (GLuint *) bp; bp += 4;
6523
GLint *location = (GLint *) bp; bp += 4;
6524
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6526
int *valueLen = (int *) bp; bp += 4;
6527
GLfloat * value = (GLfloat *) bp; bp += *valueLen*36;
6528
weglProgramUniformMatrix3fv(*program,*location,*valueLen,*transpose,value);
6530
case 5818: { // glProgramUniformMatrix4fv
6531
GLuint *program = (GLuint *) bp; bp += 4;
6532
GLint *location = (GLint *) bp; bp += 4;
6533
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6535
int *valueLen = (int *) bp; bp += 4;
6536
GLfloat * value = (GLfloat *) bp; bp += *valueLen*64;
6537
weglProgramUniformMatrix4fv(*program,*location,*valueLen,*transpose,value);
6539
case 5819: { // glProgramUniformMatrix2dv
6540
GLuint *program = (GLuint *) bp; bp += 4;
6541
GLint *location = (GLint *) bp; bp += 4;
6542
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6544
int *valueLen = (int *) bp; bp += 8;
6545
GLdouble * value = (GLdouble *) bp; bp += *valueLen*32;
6546
weglProgramUniformMatrix2dv(*program,*location,*valueLen,*transpose,value);
6548
case 5820: { // glProgramUniformMatrix3dv
6549
GLuint *program = (GLuint *) bp; bp += 4;
6550
GLint *location = (GLint *) bp; bp += 4;
6551
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6553
int *valueLen = (int *) bp; bp += 8;
6554
GLdouble * value = (GLdouble *) bp; bp += *valueLen*72;
6555
weglProgramUniformMatrix3dv(*program,*location,*valueLen,*transpose,value);
6557
case 5821: { // glProgramUniformMatrix4dv
6558
GLuint *program = (GLuint *) bp; bp += 4;
6559
GLint *location = (GLint *) bp; bp += 4;
6560
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6562
int *valueLen = (int *) bp; bp += 8;
6563
GLdouble * value = (GLdouble *) bp; bp += *valueLen*128;
6564
weglProgramUniformMatrix4dv(*program,*location,*valueLen,*transpose,value);
6566
case 5822: { // glProgramUniformMatrix2x3fv
6567
GLuint *program = (GLuint *) bp; bp += 4;
6568
GLint *location = (GLint *) bp; bp += 4;
6569
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6571
int *valueLen = (int *) bp; bp += 4;
6572
GLfloat * value = (GLfloat *) bp; bp += *valueLen*24;
6573
weglProgramUniformMatrix2x3fv(*program,*location,*valueLen,*transpose,value);
6575
case 5823: { // glProgramUniformMatrix3x2fv
6576
GLuint *program = (GLuint *) bp; bp += 4;
6577
GLint *location = (GLint *) bp; bp += 4;
6578
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6580
int *valueLen = (int *) bp; bp += 4;
6581
GLfloat * value = (GLfloat *) bp; bp += *valueLen*24;
6582
weglProgramUniformMatrix3x2fv(*program,*location,*valueLen,*transpose,value);
6584
case 5824: { // glProgramUniformMatrix2x4fv
6585
GLuint *program = (GLuint *) bp; bp += 4;
6586
GLint *location = (GLint *) bp; bp += 4;
6587
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6589
int *valueLen = (int *) bp; bp += 4;
6590
GLfloat * value = (GLfloat *) bp; bp += *valueLen*32;
6591
weglProgramUniformMatrix2x4fv(*program,*location,*valueLen,*transpose,value);
6593
case 5825: { // glProgramUniformMatrix4x2fv
6594
GLuint *program = (GLuint *) bp; bp += 4;
6595
GLint *location = (GLint *) bp; bp += 4;
6596
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6598
int *valueLen = (int *) bp; bp += 4;
6599
GLfloat * value = (GLfloat *) bp; bp += *valueLen*32;
6600
weglProgramUniformMatrix4x2fv(*program,*location,*valueLen,*transpose,value);
6602
case 5826: { // glProgramUniformMatrix3x4fv
6603
GLuint *program = (GLuint *) bp; bp += 4;
6604
GLint *location = (GLint *) bp; bp += 4;
6605
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6607
int *valueLen = (int *) bp; bp += 4;
6608
GLfloat * value = (GLfloat *) bp; bp += *valueLen*48;
6609
weglProgramUniformMatrix3x4fv(*program,*location,*valueLen,*transpose,value);
6611
case 5827: { // glProgramUniformMatrix4x3fv
6612
GLuint *program = (GLuint *) bp; bp += 4;
6613
GLint *location = (GLint *) bp; bp += 4;
6614
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6616
int *valueLen = (int *) bp; bp += 4;
6617
GLfloat * value = (GLfloat *) bp; bp += *valueLen*48;
6618
weglProgramUniformMatrix4x3fv(*program,*location,*valueLen,*transpose,value);
6620
case 5828: { // glProgramUniformMatrix2x3dv
6621
GLuint *program = (GLuint *) bp; bp += 4;
6622
GLint *location = (GLint *) bp; bp += 4;
6623
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6625
int *valueLen = (int *) bp; bp += 8;
6626
GLdouble * value = (GLdouble *) bp; bp += *valueLen*48;
6627
weglProgramUniformMatrix2x3dv(*program,*location,*valueLen,*transpose,value);
6629
case 5829: { // glProgramUniformMatrix3x2dv
6630
GLuint *program = (GLuint *) bp; bp += 4;
6631
GLint *location = (GLint *) bp; bp += 4;
6632
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6634
int *valueLen = (int *) bp; bp += 8;
6635
GLdouble * value = (GLdouble *) bp; bp += *valueLen*48;
6636
weglProgramUniformMatrix3x2dv(*program,*location,*valueLen,*transpose,value);
6638
case 5830: { // glProgramUniformMatrix2x4dv
6639
GLuint *program = (GLuint *) bp; bp += 4;
6640
GLint *location = (GLint *) bp; bp += 4;
6641
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6643
int *valueLen = (int *) bp; bp += 8;
6644
GLdouble * value = (GLdouble *) bp; bp += *valueLen*64;
6645
weglProgramUniformMatrix2x4dv(*program,*location,*valueLen,*transpose,value);
6647
case 5831: { // glProgramUniformMatrix4x2dv
6648
GLuint *program = (GLuint *) bp; bp += 4;
6649
GLint *location = (GLint *) bp; bp += 4;
6650
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6652
int *valueLen = (int *) bp; bp += 8;
6653
GLdouble * value = (GLdouble *) bp; bp += *valueLen*64;
6654
weglProgramUniformMatrix4x2dv(*program,*location,*valueLen,*transpose,value);
6656
case 5832: { // glProgramUniformMatrix3x4dv
6657
GLuint *program = (GLuint *) bp; bp += 4;
6658
GLint *location = (GLint *) bp; bp += 4;
6659
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6661
int *valueLen = (int *) bp; bp += 8;
6662
GLdouble * value = (GLdouble *) bp; bp += *valueLen*96;
6663
weglProgramUniformMatrix3x4dv(*program,*location,*valueLen,*transpose,value);
6665
case 5833: { // glProgramUniformMatrix4x3dv
6666
GLuint *program = (GLuint *) bp; bp += 4;
6667
GLint *location = (GLint *) bp; bp += 4;
6668
GLboolean *transpose = (GLboolean *) bp; bp += 1;
6670
int *valueLen = (int *) bp; bp += 8;
6671
GLdouble * value = (GLdouble *) bp; bp += *valueLen*96;
6672
weglProgramUniformMatrix4x3dv(*program,*location,*valueLen,*transpose,value);
6674
case 5834: { // glValidateProgramPipeline
6675
GLuint *pipeline = (GLuint *) bp; bp += 4;
6676
weglValidateProgramPipeline(*pipeline);
6678
case 5835: { // glGetProgramPipelineInfoLog
6679
GLuint *pipeline = (GLuint *) bp; bp += 4;
6680
GLsizei *bufSize = (GLsizei *) bp; bp += 4;
6681
GLsizei length[1] = {0};
6683
infoLog = (GLchar *) driver_alloc(sizeof(GLchar) * *bufSize);
6684
weglGetProgramPipelineInfoLog(*pipeline,*bufSize,length,infoLog);
6685
int AP = 0; ErlDrvTermData rt[7];
6686
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6687
rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) infoLog; rt[AP++] = *length;
6688
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6689
driver_send_term(port,caller,rt,AP);
6690
driver_free(infoLog);
6692
case 5836: { // glVertexAttribL1dv
6693
GLuint *index = (GLuint *) bp; bp += 4;
6695
GLdouble *v = (GLdouble *) bp; bp += 8;
6696
weglVertexAttribL1dv(*index,v);
6698
case 5837: { // glVertexAttribL2dv
6699
GLuint *index = (GLuint *) bp; bp += 4;
6701
GLdouble *v = (GLdouble *) bp; bp += 8;
6702
weglVertexAttribL2dv(*index,v);
6704
case 5838: { // glVertexAttribL3dv
6705
GLuint *index = (GLuint *) bp; bp += 4;
6707
GLdouble *v = (GLdouble *) bp; bp += 8;
6708
weglVertexAttribL3dv(*index,v);
6710
case 5839: { // glVertexAttribL4dv
6711
GLuint *index = (GLuint *) bp; bp += 4;
6713
GLdouble *v = (GLdouble *) bp; bp += 8;
6714
weglVertexAttribL4dv(*index,v);
6716
case 5840: { // glVertexAttribLPointer
6717
GLuint *index = (GLuint *) bp; bp += 4;
6718
GLint *size = (GLint *) bp; bp += 4;
6719
GLenum *type = (GLenum *) bp; bp += 4;
6720
GLsizei *stride = (GLsizei *) bp; bp += 4;
6721
GLvoid *pointer = (GLvoid *) * (int *) bp; bp += 4;
6722
weglVertexAttribLPointer(*index,*size,*type,*stride,pointer);
6724
case 5841: { // glVertexAttribLPointer
6725
GLuint *index = (GLuint *) bp; bp += 4;
6726
GLint *size = (GLint *) bp; bp += 4;
6727
GLenum *type = (GLenum *) bp; bp += 4;
6728
GLsizei *stride = (GLsizei *) bp; bp += 4;
6729
GLvoid *pointer = (GLvoid *) bins[0];
6730
weglVertexAttribLPointer(*index,*size,*type,*stride,pointer);
6732
case 5842: { // glGetVertexAttribLdv
6733
GLuint *index = (GLuint *) bp; bp += 4;
6734
GLenum *pname = (GLenum *) bp; bp += 4;
6735
GLdouble params[4] = {0.0,0.0,0.0,0.0};
6736
weglGetVertexAttribLdv(*index,*pname,params);
6737
int AP = 0; ErlDrvTermData rt[14];
6738
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6739
GLdouble *paramsTmp = params;
6740
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
6741
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
6742
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
6743
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) paramsTmp++;
6744
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 4;
6745
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6746
driver_send_term(port,caller,rt,AP);
6748
case 5843: { // glViewportArrayv
6749
GLuint *first = (GLuint *) bp; bp += 4;
6750
int *vLen = (int *) bp; bp += 4;
6751
GLfloat * v = (GLfloat *) bp; bp += *vLen*16;
6752
weglViewportArrayv(*first,*vLen,v);
6754
case 5844: { // glViewportIndexedf
6755
GLuint *index = (GLuint *) bp; bp += 4;
6756
GLfloat *x = (GLfloat *) bp; bp += 4;
6757
GLfloat *y = (GLfloat *) bp; bp += 4;
6758
GLfloat *w = (GLfloat *) bp; bp += 4;
6759
GLfloat *h = (GLfloat *) bp; bp += 4;
6760
weglViewportIndexedf(*index,*x,*y,*w,*h);
6762
case 5845: { // glViewportIndexedfv
6763
GLuint *index = (GLuint *) bp; bp += 4;
6764
GLfloat * v = (GLfloat *) bp; bp += 16;
6765
weglViewportIndexedfv(*index,v);
6767
case 5846: { // glScissorArrayv
6768
GLuint *first = (GLuint *) bp; bp += 4;
6769
int *vLen = (int *) bp; bp += 4;
6770
GLint * v = (GLint *) bp; bp += *vLen*16;
6771
weglScissorArrayv(*first,*vLen,v);
6773
case 5847: { // glScissorIndexed
6774
GLuint *index = (GLuint *) bp; bp += 4;
6775
GLint *left = (GLint *) bp; bp += 4;
6776
GLint *bottom = (GLint *) bp; bp += 4;
6777
GLsizei *width = (GLsizei *) bp; bp += 4;
6778
GLsizei *height = (GLsizei *) bp; bp += 4;
6779
weglScissorIndexed(*index,*left,*bottom,*width,*height);
6781
case 5848: { // glScissorIndexedv
6782
GLuint *index = (GLuint *) bp; bp += 4;
6783
GLint * v = (GLint *) bp; bp += 16;
6784
weglScissorIndexedv(*index,v);
6786
case 5849: { // glDepthRangeArrayv
6787
GLuint *first = (GLuint *) bp; bp += 4;
6789
int *vLen = (int *) bp; bp += 8;
6790
GLclampd * v = (GLclampd *) bp; bp += *vLen*16;
6791
weglDepthRangeArrayv(*first,*vLen,v);
6793
case 5850: { // glDepthRangeIndexed
6794
GLuint *index = (GLuint *) bp; bp += 4;
6796
GLclampd *n = (GLclampd *) bp; bp += 8;
6797
GLclampd *f = (GLclampd *) bp; bp += 8;
6798
weglDepthRangeIndexed(*index,*n,*f);
6800
case 5851: { // glGetFloati_v
6801
GLenum *target = (GLenum *) bp; bp += 4;
6802
GLuint *index = (GLuint *) bp; bp += 4;
6803
GLfloat data[16] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
6804
weglGetFloati_v(*target,*index,data);
6805
int AP = 0; ErlDrvTermData rt[39];
6806
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6807
GLdouble dataConv[16], *dataTmp = dataConv;
6808
for(int i=0; i < 16; i++) dataConv[i] = (GLdouble) data[i];
6809
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6810
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6811
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6812
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6813
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6814
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6815
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6816
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6817
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6818
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6819
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6820
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6821
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6822
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6823
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6824
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6825
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 16+1;
6826
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6827
driver_send_term(port,caller,rt,AP);
6829
case 5852: { // glGetDoublei_v
6830
GLenum *target = (GLenum *) bp; bp += 4;
6831
GLuint *index = (GLuint *) bp; bp += 4;
6832
GLdouble data[16] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
6833
weglGetDoublei_v(*target,*index,data);
6834
int AP = 0; ErlDrvTermData rt[39];
6835
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6836
GLdouble *dataTmp = data;
6837
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6838
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6839
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6840
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6841
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6842
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6843
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6844
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6845
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6846
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6847
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6848
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6849
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6850
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6851
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6852
rt[AP++] = ERL_DRV_FLOAT; rt[AP++] = (ErlDrvTermData) dataTmp++;
6853
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = 16+1;
6854
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6855
driver_send_term(port,caller,rt,AP);
6857
case 5853: { // glDebugMessageControlARB
6858
GLenum *source = (GLenum *) bp; bp += 4;
6859
GLenum *type = (GLenum *) bp; bp += 4;
6860
GLenum *severity = (GLenum *) bp; bp += 4;
6861
int * idsLen = (int *) bp; bp += 4;
6862
GLuint * ids = (GLuint *) bp; bp += (8-((*idsLen*4+0)%8))%8;
6863
GLboolean *enabled = (GLboolean *) bp; bp += 1;
6864
weglDebugMessageControlARB(*source,*type,*severity,*idsLen,ids,*enabled);
6866
case 5854: { // glDebugMessageInsertARB
6867
GLenum *source = (GLenum *) bp; bp += 4;
6868
GLenum *type = (GLenum *) bp; bp += 4;
6869
GLuint *id = (GLuint *) bp; bp += 4;
6870
GLenum *severity = (GLenum *) bp; bp += 4;
6871
GLchar *buf = (GLchar *) bp;
6872
int bufLen[1] = {strlen((char *)buf)}; bp += bufLen[0]+1+((8-((1+bufLen[0]+0)%8))%8);
6873
weglDebugMessageInsertARB(*source,*type,*id,*severity,*bufLen,buf);
6875
case 5855: { // glGetDebugMessageLogARB
6876
GLuint *count = (GLuint *) bp; bp += 4;
6877
GLsizei *bufsize = (GLsizei *) bp; bp += 4;
6879
sources = (GLenum *) driver_alloc(sizeof(GLenum) * *count);
6881
types = (GLenum *) driver_alloc(sizeof(GLenum) * *count);
6883
ids = (GLuint *) driver_alloc(sizeof(GLuint) * *count);
6885
severities = (GLenum *) driver_alloc(sizeof(GLenum) * *count);
6887
lengths = (GLsizei *) driver_alloc(sizeof(GLsizei) * *count);
6889
messageLog = (GLchar *) driver_alloc(sizeof(GLchar) * *bufsize);
6890
GLuint result = weglGetDebugMessageLogARB(*count,*bufsize,sources,types,ids,severities,lengths,messageLog);
6891
int AP = 0; ErlDrvTermData *rt;
6892
rt = (ErlDrvTermData *) driver_alloc(sizeof(ErlDrvTermData)*(23 + result*3 + result*2 + result*2 + result*2 + result*2));
6893
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6894
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
6895
for(int i=0; i < (int) result; i++) {
6896
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) sources[i];}
6897
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = ((int) result)+1;
6898
for(int i=0; i < (int) result; i++) {
6899
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) types[i];}
6900
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = ((int) result)+1;
6901
for(int i=0; i < (int) result; i++) {
6902
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) ids[i];}
6903
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = ((int) result)+1;
6904
for(int i=0; i < (int) result; i++) {
6905
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) severities[i];}
6906
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = ((int) result)+1;
6907
for(int i=0; i < (int) result; i++) {
6908
rt[AP++] = ERL_DRV_STRING; rt[AP++] = (ErlDrvTermData) messageLog; rt[AP++] = lengths[i]-1;
6909
messageLog += lengths[i]; }
6910
rt[AP++] = ERL_DRV_NIL; rt[AP++] = ERL_DRV_LIST; rt[AP++] = ((int) result)+1;
6911
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 6;
6912
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6913
driver_send_term(port,caller,rt,AP);
6915
driver_free(messageLog);
6916
driver_free(lengths);
6917
driver_free(severities);
6920
driver_free(sources);
6922
case 5856: { // glGetGraphicsResetStatusARB
6923
GLenum result = weglGetGraphicsResetStatusARB();
6924
int AP = 0; ErlDrvTermData rt[6];
6925
rt[AP++]=ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_result_");
6926
rt[AP++] = ERL_DRV_INT; rt[AP++] = (ErlDrvSInt) result;
6927
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6928
driver_send_term(port,caller,rt,AP);
6930
case 5857: { // glResizeBuffersMESA
5377
6931
weglResizeBuffersMESA();
5379
case 5677: { // glWindowPos4dvMESA
6933
case 5858: { // glWindowPos4dvMESA
5380
6934
GLdouble *v = (GLdouble *) bp; bp += 8;
5381
6935
weglWindowPos4dvMESA(v);
5383
case 5678: { // glWindowPos4fvMESA
6937
case 5859: { // glWindowPos4fvMESA
5384
6938
GLfloat *v = (GLfloat *) bp; bp += 4;
5385
6939
weglWindowPos4fvMESA(v);
5387
case 5679: { // glWindowPos4ivMESA
6941
case 5860: { // glWindowPos4ivMESA
5388
6942
GLint *v = (GLint *) bp; bp += 4;
5389
6943
weglWindowPos4ivMESA(v);
5391
case 5680: { // glWindowPos4svMESA
6945
case 5861: { // glWindowPos4svMESA
5392
6946
GLshort *v = (GLshort *) bp; bp += 2;
5393
6947
weglWindowPos4svMESA(v);
5395
case 5681: { // glDepthBoundsEXT
6949
case 5862: { // glDepthBoundsEXT
5396
6950
GLclampd *zmin = (GLclampd *) bp; bp += 8;
5397
6951
GLclampd *zmax = (GLclampd *) bp; bp += 8;
5398
6952
weglDepthBoundsEXT(*zmin,*zmax);
5400
case 5682: { // glStencilClearTagEXT
6954
case 5863: { // glStencilClearTagEXT
5401
6955
GLsizei *stencilTagBits = (GLsizei *) bp; bp += 4;
5402
6956
GLuint *stencilClearTag = (GLuint *) bp; bp += 4;
5403
6957
weglStencilClearTagEXT(*stencilTagBits,*stencilClearTag);
6959
}} catch (char *err_msg) {
6960
int AP = 0; ErlDrvTermData rt[12];
6961
rt[AP++] = ERL_DRV_ATOM; rt[AP++]=driver_mk_atom((char *) "_egl_error_");
6962
rt[AP++] = ERL_DRV_INT; rt[AP++] = (int) op;
6963
rt[AP++] = ERL_DRV_ATOM; rt[AP++] = driver_mk_atom((char *) err_msg);
6964
// rt[AP++] = ERL_DRV_ATOM; rt[AP++] = driver_mk_atom((char *) gl_fns[op-GLE_GL_FUNC_START].name);
6965
// rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 2;
6966
rt[AP++] = ERL_DRV_TUPLE; rt[AP++] = 3;
6967
driver_send_term(port,caller,rt,AP);
5405
6968
}} /* The End */