mirror of
https://github.com/danbulant/node-x11
synced 2026-05-20 21:09:10 +00:00
link to a very good glx implementation
This commit is contained in:
parent
1b2c0cbfd5
commit
dc1050afb4
1 changed files with 7 additions and 4 deletions
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
http://www.opengl.org/wiki/Tutorial:_OpenGL_3.0_Context_Creation_(GLX)
|
||||
|
||||
https://github.com/xderoche/J11/blob/master/src/gnu/x11/extension/glx/GL.java
|
||||
|
||||
|
||||
*/
|
||||
var x11 = require('..');
|
||||
// TODO: move to templates
|
||||
|
|
@ -253,11 +256,11 @@ exports.requireExt = function(display, callback)
|
|||
// 1330 - X_GLXvop_BindTexImageEXT
|
||||
// 1331 - X_GLXvop_ReleaseTexImageEXT
|
||||
ext.BindTexImage = function(ctx, drawable, buffer, attribs) {
|
||||
if (!attribs)
|
||||
if (!attribs)
|
||||
attribs = [];
|
||||
var data = new Buffer(12 + attribs.length*4);
|
||||
data.writeUInt32LE(drawable, 0);
|
||||
data.writeUInt32LE(buffer, 4);
|
||||
data.writeUInt32LE(drawable, 0);
|
||||
data.writeUInt32LE(buffer, 4);
|
||||
data.writeUInt32LE(attribs.length, 8);
|
||||
for (var i=0; i < attribs.length; ++i)
|
||||
data.writeUint32LE(attribs.length, 12+i*4);
|
||||
|
|
@ -278,7 +281,7 @@ exports.requireExt = function(display, callback)
|
|||
|
||||
//var data = Buffer.concat(data);
|
||||
var padLength = 4 - data.length % 4;
|
||||
if (padLength == 4)
|
||||
if (padLength == 4)
|
||||
padLength = 0;
|
||||
var length = 4 + (data.length+padLength) / 4;
|
||||
X.pack_stream.pack('CCSLSSL', [ext.majorOpcode, 2, length, ctx, requestNum, requestTotal, data.length]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue