mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-07 07:24:20 +00:00
First commit of Direct3D extension.
This commit is contained in:
parent
31a1fe4d4f
commit
ed3261718f
89 changed files with 9604 additions and 0 deletions
63
src/java/org/lwjgl/d3d/D3DRectPatchInfo.java
Normal file
63
src/java/org/lwjgl/d3d/D3DRectPatchInfo.java
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
package org.lwjgl.d3d;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public class D3DRectPatchInfo {
|
||||
public int StartVertexOffsetWidth; //4 UINT
|
||||
public int StartVertexOffsetHeight; //4 UINT
|
||||
public int Width; //4 UINT
|
||||
public int Height; //4 UINT
|
||||
public int Stride; //4 UINT
|
||||
public int Basis; //4 D3DBASISTYPE
|
||||
public int Degree; //4 D3DDEGREETYPE
|
||||
|
||||
private static final int D3D_RECT_PATCH_INFO_BYTE_SIZE = 28;
|
||||
|
||||
private ByteBuffer buffer;
|
||||
|
||||
public D3DRectPatchInfo() {
|
||||
buffer = ByteBuffer.allocateDirect(D3D_RECT_PATCH_INFO_BYTE_SIZE);
|
||||
buffer.order(ByteOrder.nativeOrder());
|
||||
buffer.clear();
|
||||
}
|
||||
|
||||
public ByteBuffer getEmptyBuffer() {
|
||||
buffer.rewind();
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public ByteBuffer getBuffer() {
|
||||
buffer.rewind();
|
||||
buffer.putInt(StartVertexOffsetWidth);
|
||||
buffer.putInt(StartVertexOffsetHeight);
|
||||
buffer.putInt(Width);
|
||||
buffer.putInt(Height);
|
||||
buffer.putInt(Stride);
|
||||
buffer.putInt(Basis);
|
||||
buffer.putInt(Degree);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
public void setBuffer(ByteBuffer buffer) {
|
||||
buffer.rewind();
|
||||
StartVertexOffsetWidth = buffer.getInt();
|
||||
StartVertexOffsetHeight = buffer.getInt();
|
||||
Width = buffer.getInt();
|
||||
Height = buffer.getInt();
|
||||
Stride = buffer.getInt();
|
||||
Basis = buffer.getInt();
|
||||
Degree = buffer.getInt();
|
||||
}
|
||||
public String toString() {
|
||||
return
|
||||
"\n StartVertexOffsetWidth = " + StartVertexOffsetWidth +
|
||||
"\nStartVertexOffsetHeight = " + StartVertexOffsetHeight +
|
||||
"\n Width = " + Width +
|
||||
"\n Height = " + Height +
|
||||
"\n Stride = " + Stride +
|
||||
"\n Basis = " + Basis +
|
||||
"\n Degree = " + Degree;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue