Exemplo n.º 1
0
  public static LWJGL3TextureSpec getTextureSpec(final JCGLTextureFormat format) {
    NullCheck.notNull(format);

    Preconditions.checkPrecondition(
        format,
        LWJGL3TextureSpecs.SPECS.containsKey(format),
        ignored -> "Format specification must be known");

    return LWJGL3TextureSpecs.SPECS.get(format);
  }
Exemplo n.º 2
0
  private static Map<JCGLTextureFormat, LWJGL3TextureSpec> makeTextureSpecs() {
    final Map<JCGLTextureFormat, LWJGL3TextureSpec> m = new EnumMap<>(JCGLTextureFormat.class);

    final JCGLTextureFormat[] values = JCGLTextureFormat.values();
    for (int index = 0; index < values.length; ++index) {
      final JCGLTextureFormat format = values[index];
      final LWJGL3TextureSpec spec = LWJGL3TextureSpecs.makeTextureSpec(format);

      Preconditions.checkPrecondition(
          format, !m.containsKey(format), ignored -> "Format must be unique");

      m.put(format, spec);
    }

    return m;
  }