/** * Returns the parameter set on this material with the given name, * returns <code>null</code> if the parameter is not set. * * @param name The parameter name to look up. * @return The MatParam if set, or null if not set. */ public MatParam getParam(String name) { return paramValues.get(name); }
@Test public void testListMap() { ListMap<String, String> listMap = new ListMap<String, String>(); listMap.put("bob", "hello"); assert "hello".equals(listMap.get("bob")); assert "hello".equals(listMap.remove("bob")); assert listMap.size() == 0; assert listMap.isEmpty(); listMap.put("abc", "1"); listMap.put("def", "2"); listMap.put("ghi", "3"); listMap.put("jkl", "4"); listMap.put("mno", "5"); assert "3".equals(listMap.get("ghi")); assert listMap.size() == 5; assert !listMap.isEmpty(); // check iteration order, should be consistent for (int i = 0; i < listMap.size(); i++) { String expectedValue = Integer.toString(i + 1); String key = listMap.getKey(i); String value = listMap.getValue(i); Entry<String, String> entry = listMap.getEntry(i); assert key.equals(entry.getKey()); assert value.equals(entry.getValue()); assert expectedValue.equals(value); } } }
/** * Returns the texture parameter set on this material with the given name, * returns <code>null</code> if the parameter is not set. * * @param name The parameter name to look up. * @return The MatParamTexture if set, or null if not set. */ public MatParamTexture getTextureParam(String name) { MatParam param = paramValues.get(name); if (param instanceof MatParamTexture) { return (MatParamTexture) param; } return null; }
/** * Returns the current parameter's value. * * @param name the parameter name to look up. * @return current value or null if the parameter wasn't set. */ public <T> T getParamValue(final String name) { final MatParam param = paramValues.get(name); return param == null ? null : (T) param.getValue(); }
public Uniform getUniform(String name){ assert name.startsWith("m_") || name.startsWith("g_"); Uniform uniform = uniforms.get(name); if (uniform == null){ uniform = new Uniform(); uniform.name = name; uniforms.put(name, uniform); } return uniform; }
/** * Gets or creates a buffer block by the name. * * @param name the buffer block's name. * @return the buffer block. */ public ShaderBufferBlock getBufferBlock(final String name) { assert name.startsWith("m_"); ShaderBufferBlock block = bufferBlocks.get(name); if (block == null) { block = new ShaderBufferBlock(); block.name = name; bufferBlocks.put(name, block); } return block; }
public void addUniformBinding(UniformBinding binding){ String uniformName = "g_" + binding.name(); Uniform uniform = uniforms.get(uniformName); if (uniform == null) { uniform = new Uniform(); uniform.name = uniformName; uniform.binding = binding; uniforms.put(uniformName, uniform); boundUniforms.add(uniform); } }
if (param.getValue() != null && paramValues.get(param.getName()) == null) { setParam(param.getName(), param.getVarType(), param.getValue());
/** * Returns the material parameter with the given name. * * @param name The name of the parameter to retrieve * * @return The material parameter, or null if it does not exist. */ public MatParam getMaterialParam(String name){ return matParams.get(name); }
/** * Returns the parameter set on this material with the given name, * returns <code>null</code> if the parameter is not set. * * @param name The parameter name to look up. * @return The MatParam if set, or null if not set. */ public MatParam getParam(String name) { return paramValues.get(name); }
/** * Returns the texture parameter set on this material with the given name, * returns <code>null</code> if the parameter is not set. * * @param name The parameter name to look up. * @return The MatParamTexture if set, or null if not set. */ public MatParamTexture getTextureParam(String name) { MatParam param = paramValues.get(name); if (param instanceof MatParamTexture) { return (MatParamTexture) param; } return null; }
/** * Returns the texture parameter set on this material with the given name, * returns <code>null</code> if the parameter is not set. * * @param name The parameter name to look up. * @return The MatParamTexture if set, or null if not set. */ public MatParamTexture getTextureParam(String name) { MatParam param = paramValues.get(name); if (param instanceof MatParamTexture) { return (MatParamTexture) param; } return null; }
/** * Returns the parameter set on this material with the given name, * returns <code>null</code> if the parameter is not set. * * @param name The parameter name to look up. * @return The MatParam if set, or null if not set. */ public MatParam getParam(String name) { MatParam param = paramValues.get(name); if (param instanceof MatParam) { return (MatParam) param; } return null; }
public Uniform getUniform(String name){ assert name.startsWith("m_") || name.startsWith("g_"); Uniform uniform = uniforms.get(name); if (uniform == null){ uniform = new Uniform(); uniform.name = name; uniforms.put(name, uniform); } return uniform; }
public Uniform getUniform(String name){ Uniform uniform = uniforms.get(name); if (uniform == null){ uniform = new Uniform(); uniform.name = name; uniforms.put(name, uniform); } return uniform; }
public void addUniformBinding(UniformBinding binding){ String uniformName = "g_" + binding.name(); Uniform uniform = uniforms.get(uniformName); if (uniform == null) { uniform = new Uniform(); uniform.name = uniformName; uniform.binding = binding; uniforms.put(uniformName, uniform); boundUniforms.add(uniform); } }
if (param.getValue() != null && paramValues.get(param.getName()) == null){ setParam(param.getPrefixedName(), param.getVarType(), param.getValue());
if (param.getValue() != null && paramValues.get(param.getName()) == null) { setParam(param.getName(), param.getVarType(), param.getValue());