Skip to content

Commit

Permalink
Merge branch 'gl-render-maintainable' of github.com:JoopAue/jmonkeyen…
Browse files Browse the repository at this point in the history
…gine into gl-render-maintainable

# Conflicts:
#	jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
  • Loading branch information
JoopAue committed Apr 3, 2016
2 parents f86a574 + 16c474d commit d093aa8
Showing 1 changed file with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jme3.renderer.opengl;

import com.jme3.renderer.Caps;
import com.jme3.renderer.Limits;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
Expand Down Expand Up @@ -124,4 +125,67 @@ public void loadCapabilitiesGLSL1Support() throws Exception {
assertTrue(r.caps.contains(Caps.GLSL110));
assertTrue(r.caps.contains(Caps.GLSL100));
}

@Test
public void loadCapabilitiesCommon() {
doReturn(300).when(r).extractVersion(null);

r.initialize();

verify(r).loadExtensions();
assertTrue(r.limits.get(Limits.VertexTextureUnits) == r.getInteger(GL.GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS));
assertFalse(r.caps.contains(Caps.VertexTextureFetch));
assertTrue(r.limits.get(Limits.FragmentTextureUnits) == r.getInteger(GL.GL_MAX_TEXTURE_IMAGE_UNITS));
assertTrue(r.limits.get(Limits.VertexUniformVectors) == r.getInteger(GL.GL_MAX_VERTEX_UNIFORM_VECTORS));
assertTrue(r.limits.get(Limits.VertexAttributes) == r.getInteger(GL.GL_MAX_VERTEX_ATTRIBS));
assertTrue(r.limits.get(Limits.TextureSize) == r.getInteger(GL.GL_MAX_TEXTURE_SIZE));
assertTrue(r.limits.get(Limits.CubemapSize) == r.getInteger(GL.GL_MAX_CUBE_MAP_TEXTURE_SIZE));
assertFalse(r.caps.contains(Caps.MeshInstancing));
assertTrue(r.caps.contains(Caps.IntegerIndexBuffer));
assertFalse(r.caps.contains(Caps.TextureBuffer));

// texture format
assertTrue(r.caps.contains(Caps.OpenGL30));
assertTrue(r.caps.contains(Caps.FloatTexture));
assertTrue(r.caps.contains(Caps.DepthTexture));
assertFalse(r.caps.contains(Caps.Rgba8));
assertTrue(r.caps.contains(Caps.PackedDepthStencilBuffer));
assertFalse(r.caps.contains(Caps.FloatColorBuffer));
assertFalse(r.caps.contains(Caps.FloatDepthBuffer));
assertTrue(r.caps.contains(Caps.PackedFloatColorBuffer));
assertTrue(r.caps.contains(Caps.PackedFloatTexture));
assertTrue(r.caps.contains(Caps.SharedExponentTexture));
assertFalse(r.caps.contains(Caps.TextureCompressionS3TC));
assertFalse(r.caps.contains(Caps.TextureCompressionETC2));
assertFalse(r.caps.contains(Caps.TextureCompressionETC1));
assertFalse(r.caps.contains(Caps.TextureCompressionETC1));
// end texture format

assertTrue(r.caps.contains(Caps.VertexBufferArray));
assertTrue(r.caps.contains(Caps.NonPowerOfTwoTextures));
assertFalse(r.caps.contains(Caps.PartialNonPowerOfTwoTextures));
assertTrue(r.caps.contains(Caps.TextureArray));
assertFalse(r.caps.contains(Caps.TextureFilterAnisotropic));
assertFalse(r.limits.containsKey(Limits.TextureAnisotropy));

// big if statement
assertTrue(r.caps.contains(Caps.FrameBuffer));
assertTrue(r.limits.get(Limits.RenderBufferSize) == r.getInteger(GLFbo.GL_MAX_RENDERBUFFER_SIZE_EXT));
assertTrue(r.limits.get(Limits.FrameBufferAttachments) == r.getInteger(GLFbo.GL_MAX_COLOR_ATTACHMENTS_EXT));
assertTrue(r.caps.contains(Caps.FrameBufferBlit));
assertFalse(r.caps.contains(Caps.FrameBufferMultisample));
assertFalse(r.limits.containsKey(Limits.FrameBufferSamples));
assertFalse(r.caps.contains(Caps.TextureMultisample));
assertFalse(r.limits.containsKey(Limits.ColorTextureSamples));
assertFalse(r.limits.containsKey(Limits.DepthTextureSamples));
assertTrue(r.limits.get(Limits.FrameBufferMrtAttachments) == r.getInteger(GLExt.GL_MAX_DRAW_BUFFERS_ARB));
assertFalse(r.caps.contains(Caps.FrameBufferMRT));
// end big if statement

assertFalse(r.caps.contains(Caps.Multisample));
assertTrue(r.caps.contains(Caps.Srgb));
assertFalse(r.caps.contains(Caps.SeamlessCubemap));
assertFalse(r.caps.contains(Caps.CoreProfile));
assertFalse(r.caps.contains(Caps.BinaryShader));
}
}

0 comments on commit d093aa8

Please sign in to comment.