mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-06 23:14:19 +00:00
Added support for doubles (ALdouble and GLdouble)
This commit is contained in:
parent
965b0e1ec4
commit
140e3fa3b7
74 changed files with 2337 additions and 97 deletions
|
|
@ -238,7 +238,8 @@ final class Context {
|
|||
boolean was_current = isCurrent();
|
||||
int error = GL11.GL_NO_ERROR;
|
||||
if (was_current) {
|
||||
error = GL11.glGetError();
|
||||
if (GLContext.getCapabilities() != null && GLContext.getCapabilities().OpenGL11)
|
||||
error = GL11.glGetError();
|
||||
releaseCurrentContext();
|
||||
}
|
||||
checkDestroy();
|
||||
|
|
|
|||
|
|
@ -204,10 +204,10 @@ public class GL {
|
|||
}
|
||||
|
||||
/** @param c */
|
||||
public static void glClearIndex(float c) {
|
||||
/* public static void glClearIndex(float c) {
|
||||
GL11.glClearIndex(c);
|
||||
}
|
||||
|
||||
*/
|
||||
/** @param s */
|
||||
public static void glClearStencil(int s) {
|
||||
GL11.glClearStencil(s);
|
||||
|
|
|
|||
|
|
@ -541,10 +541,10 @@ public class GLImpl implements IGL {
|
|||
/**
|
||||
* @param c
|
||||
*/
|
||||
public void glClearIndex(float c) {
|
||||
/* public void glClearIndex(float c) {
|
||||
GL.glClearIndex(c);
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
* @param s
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ public interface IGL {
|
|||
/**
|
||||
* @param c
|
||||
*/
|
||||
void glClearIndex(float c);
|
||||
// void glClearIndex(float c);
|
||||
|
||||
/**
|
||||
* @param s
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public class ALTypeMap implements TypeMap {
|
|||
native_types_to_primitive.put(ALbyte.class, PrimitiveType.Kind.BYTE);
|
||||
native_types_to_primitive.put(ALenum.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(ALfloat.class, PrimitiveType.Kind.FLOAT);
|
||||
native_types_to_primitive.put(ALdouble.class, PrimitiveType.Kind.DOUBLE);
|
||||
native_types_to_primitive.put(ALint.class, PrimitiveType.Kind.INT);
|
||||
native_types_to_primitive.put(ALshort.class, PrimitiveType.Kind.SHORT);
|
||||
native_types_to_primitive.put(ALsizei.class, PrimitiveType.Kind.INT);
|
||||
|
|
@ -96,6 +97,8 @@ public class ALTypeMap implements TypeMap {
|
|||
return "b";
|
||||
else if (annotation_type.equals(ALfloat.class))
|
||||
return "f";
|
||||
else if (annotation_type.equals(ALdouble.class))
|
||||
return "d";
|
||||
else if (annotation_type.equals(ALboolean.class) || annotation_type.equals(ALvoid.class))
|
||||
return "";
|
||||
else
|
||||
|
|
@ -111,6 +114,9 @@ public class ALTypeMap implements TypeMap {
|
|||
case FLOAT:
|
||||
type = ALfloat.class;
|
||||
break;
|
||||
case DOUBLE:
|
||||
type = ALdouble.class;
|
||||
break;
|
||||
case SHORT:
|
||||
type = ALshort.class;
|
||||
break;
|
||||
|
|
@ -136,7 +142,7 @@ public class ALTypeMap implements TypeMap {
|
|||
else if (type.equals(ShortBuffer.class))
|
||||
return new Class[]{ALshort.class};
|
||||
else if (type.equals(DoubleBuffer.class))
|
||||
return new Class[]{};
|
||||
return new Class[]{ALdouble.class};
|
||||
else
|
||||
return new Class[]{};
|
||||
}
|
||||
|
|
@ -145,7 +151,7 @@ public class ALTypeMap implements TypeMap {
|
|||
if (type.equals(int.class))
|
||||
return new Class[]{ALenum.class, ALint.class, ALsizei.class, ALuint.class};
|
||||
else if (type.equals(double.class))
|
||||
return new Class[]{};
|
||||
return new Class[]{ALdouble.class};
|
||||
else if (type.equals(float.class))
|
||||
return new Class[]{ALfloat.class};
|
||||
else if (type.equals(short.class))
|
||||
|
|
|
|||
47
src/java/org/lwjgl/util/generator/ALdouble.java
Normal file
47
src/java/org/lwjgl/util/generator/ALdouble.java
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2004 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.util.generator;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
*
|
||||
* @author elias_naur <elias_naur@users.sourceforge.net>
|
||||
* @version $Revision$
|
||||
*/
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
@NativeType
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface ALdouble {
|
||||
}
|
||||
|
|
@ -125,6 +125,8 @@ public class GLTypeMap implements TypeMap {
|
|||
return "b";
|
||||
else if (annotation_type.equals(GLfloat.class))
|
||||
return "f";
|
||||
else if (annotation_type.equals(GLdouble.class))
|
||||
return "d";
|
||||
else if (annotation_type.equals(GLhalf.class))
|
||||
return "h";
|
||||
else if (annotation_type.equals(GLboolean.class) || annotation_type.equals(GLvoid.class))
|
||||
|
|
@ -258,6 +260,8 @@ public class GLTypeMap implements TypeMap {
|
|||
return "GL11.GL_UNSIGNED_SHORT";
|
||||
else if (annotation_class.equals(GLfloat.class))
|
||||
return "GL11.GL_FLOAT";
|
||||
else if (annotation_class.equals(GLdouble.class))
|
||||
return "GL11.GL_DOUBLE";
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue