コード例 #1
0
ファイル: Main.java プロジェクト: Osoldier/Vox
 private void InitGL() {
   GL.createCapabilities();
   System.out.println("OpenGL: " + glGetString(GL_VERSION));
   glEnable(GL13.GL_MULTISAMPLE);
   glEnable(GL_DEPTH_TEST);
   glViewport(0, 0, pix_width, pix_height);
 }
コード例 #2
0
  static GL15 create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("OpenGL15")) return null;

    GL15 funcs = new GL15(provider);

    boolean supported =
        checkFunctions(
            funcs.BindBuffer,
            funcs.DeleteBuffers,
            funcs.GenBuffers,
            funcs.IsBuffer,
            funcs.BufferData,
            funcs.BufferSubData,
            funcs.GetBufferSubData,
            funcs.MapBuffer,
            funcs.UnmapBuffer,
            funcs.GetBufferParameteriv,
            funcs.GetBufferPointerv,
            funcs.GenQueries,
            funcs.DeleteQueries,
            funcs.IsQuery,
            funcs.BeginQuery,
            funcs.EndQuery,
            funcs.GetQueryiv,
            funcs.GetQueryObjectiv,
            funcs.GetQueryObjectuiv);

    return GL.checkExtension("OpenGL15", funcs, supported);
  }
コード例 #3
0
  static WGLARBMakeCurrentRead create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("WGL_ARB_make_current_read")) return null;

    WGLARBMakeCurrentRead funcs = new WGLARBMakeCurrentRead(provider);

    boolean supported = checkFunctions(funcs.MakeContextCurrentARB, funcs.GetCurrentReadDCARB);

    return GL.checkExtension("WGL_ARB_make_current_read", funcs, supported);
  }
コード例 #4
0
  static ARBCopyImage create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GL_ARB_copy_image")) return null;

    ARBCopyImage funcs = new ARBCopyImage(provider);

    boolean supported = checkFunctions(funcs.CopyImageSubData);

    return GL.checkExtension("GL_ARB_copy_image", funcs, supported);
  }
コード例 #5
0
  static ARBTextureBarrier create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GL_ARB_texture_barrier")) return null;

    ARBTextureBarrier funcs = new ARBTextureBarrier(provider);

    boolean supported = checkFunctions(funcs.TextureBarrier);

    return GL.checkExtension("GL_ARB_texture_barrier", funcs, supported);
  }
コード例 #6
0
  static GLX11 create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GLX_11")) return null;

    GLX11 funcs = new GLX11(provider);

    boolean supported =
        checkFunctions(funcs.QueryExtensionsString, funcs.GetClientString, funcs.QueryServerString);

    return GL.checkExtension("GLX_11", funcs, supported);
  }
  static NVBindlessMultiDrawIndirectCount create(
      java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GL_NV_bindless_multi_draw_indirect_count")) return null;

    NVBindlessMultiDrawIndirectCount funcs = new NVBindlessMultiDrawIndirectCount(provider);

    boolean supported =
        checkFunctions(
            funcs.MultiDrawArraysIndirectBindlessCountNV,
            funcs.MultiDrawElementsIndirectBindlessCountNV);

    return GL.checkExtension("GL_NV_bindless_multi_draw_indirect_count", funcs, supported);
  }
コード例 #8
0
  static GL12 create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("OpenGL12")) return null;

    GL12 funcs = new GL12(provider);

    boolean supported =
        checkFunctions(
            funcs.TexImage3D,
            funcs.TexSubImage3D,
            funcs.CopyTexSubImage3D,
            funcs.DrawRangeElements);

    return GL.checkExtension("OpenGL12", funcs, supported);
  }
コード例 #9
0
  static WGLNVGPUAffinity create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("WGL_NV_gpu_affinity")) return null;

    WGLNVGPUAffinity funcs = new WGLNVGPUAffinity(provider);

    boolean supported =
        checkFunctions(
            funcs.EnumGpusNV,
            funcs.EnumGpuDevicesNV,
            funcs.CreateAffinityDCNV,
            funcs.EnumGpusFromAffinityDCNV,
            funcs.DeleteDCNV);

    return GL.checkExtension("WGL_NV_gpu_affinity", funcs, supported);
  }
コード例 #10
0
  static GLXEXTImportContext create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GLX_EXT_import_context")) return null;

    GLXEXTImportContext funcs = new GLXEXTImportContext(provider);

    boolean supported =
        checkFunctions(
            funcs.GetCurrentDisplayEXT,
            funcs.QueryContextInfoEXT,
            funcs.GetContextIDEXT,
            funcs.ImportContextEXT,
            funcs.FreeContextEXT);

    return GL.checkExtension("GLX_EXT_import_context", funcs, supported);
  }
コード例 #11
0
  static EXTTextureInteger create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GL_EXT_texture_integer")) return null;

    EXTTextureInteger funcs = new EXTTextureInteger(provider);

    boolean supported =
        checkFunctions(
            funcs.ClearColorIiEXT,
            funcs.ClearColorIuiEXT,
            funcs.TexParameterIivEXT,
            funcs.TexParameterIuivEXT,
            funcs.GetTexParameterIivEXT,
            funcs.GetTexParameterIuivEXT);

    return GL.checkExtension("GL_EXT_texture_integer", funcs, supported);
  }
コード例 #12
0
ファイル: WGLNVDXInterop.java プロジェクト: Neogs12/GVue
  static WGLNVDXInterop create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("WGL_NV_DX_interop")) return null;

    WGLNVDXInterop funcs = new WGLNVDXInterop(provider);

    boolean supported =
        checkFunctions(
            funcs.DXSetResourceShareHandleNV,
            funcs.DXOpenDeviceNV,
            funcs.DXCloseDeviceNV,
            funcs.DXRegisterObjectNV,
            funcs.DXUnregisterObjectNV,
            funcs.DXObjectAccessNV,
            funcs.DXLockObjectsNV,
            funcs.DXUnlockObjectsNV);

    return GL.checkExtension("WGL_NV_DX_interop", funcs, supported);
  }
コード例 #13
0
  static ARBShaderSubroutine create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GL_ARB_shader_subroutine")) return null;

    ARBShaderSubroutine funcs = new ARBShaderSubroutine(provider);

    boolean supported =
        checkFunctions(
            funcs.GetSubroutineUniformLocation,
            funcs.GetSubroutineIndex,
            funcs.GetActiveSubroutineUniformiv,
            funcs.GetActiveSubroutineUniformName,
            funcs.GetActiveSubroutineName,
            funcs.UniformSubroutinesuiv,
            funcs.GetUniformSubroutineuiv,
            funcs.GetProgramStageiv);

    return GL.checkExtension("GL_ARB_shader_subroutine", funcs, supported);
  }
コード例 #14
0
  static GLXAMDGPUAssociation create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GLX_AMD_gpu_association")) return null;

    GLXAMDGPUAssociation funcs = new GLXAMDGPUAssociation(provider);

    boolean supported =
        checkFunctions(
            funcs.BlitContextFramebufferAMD,
            funcs.CreateAssociatedContextAMD,
            funcs.CreateAssociatedContextAttribsAMD,
            funcs.DeleteAssociatedContextAMD,
            funcs.GetContextGPUIDAMD,
            funcs.GetCurrentAssociatedContextAMD,
            funcs.GetGPUIDsAMD,
            funcs.GetGPUInfoAMD,
            funcs.MakeAssociatedContextCurrentAMD);

    return GL.checkExtension("GLX_AMD_gpu_association", funcs, supported);
  }
コード例 #15
0
  static ARBViewportArray create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GL_ARB_viewport_array")) return null;

    ARBViewportArray funcs = new ARBViewportArray(provider);

    boolean supported =
        checkFunctions(
            funcs.ViewportArrayv,
            funcs.ViewportIndexedf,
            funcs.ViewportIndexedfv,
            funcs.ScissorArrayv,
            funcs.ScissorIndexed,
            funcs.ScissorIndexedv,
            funcs.DepthRangeArrayv,
            funcs.DepthRangeIndexed,
            funcs.GetFloati_v,
            funcs.GetDoublei_v);

    return GL.checkExtension("GL_ARB_viewport_array", funcs, supported);
  }
コード例 #16
0
  static ARBUniformBufferObject create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GL_ARB_uniform_buffer_object")) return null;

    ARBUniformBufferObject funcs = new ARBUniformBufferObject(provider);

    boolean supported =
        checkFunctions(
            funcs.GetUniformIndices,
            funcs.GetActiveUniformsiv,
            funcs.GetActiveUniformName,
            funcs.GetUniformBlockIndex,
            funcs.GetActiveUniformBlockiv,
            funcs.GetActiveUniformBlockName,
            funcs.BindBufferRange,
            funcs.BindBufferBase,
            funcs.GetIntegeri_v,
            funcs.UniformBlockBinding);

    return GL.checkExtension("GL_ARB_uniform_buffer_object", funcs, supported);
  }
コード例 #17
0
  static AMDPerformanceMonitor create(java.util.Set<String> ext, FunctionProvider provider) {
    if (!ext.contains("GL_AMD_performance_monitor")) return null;

    AMDPerformanceMonitor funcs = new AMDPerformanceMonitor(provider);

    boolean supported =
        checkFunctions(
            funcs.GetPerfMonitorGroupsAMD,
            funcs.GetPerfMonitorCountersAMD,
            funcs.GetPerfMonitorGroupStringAMD,
            funcs.GetPerfMonitorCounterStringAMD,
            funcs.GetPerfMonitorCounterInfoAMD,
            funcs.GenPerfMonitorsAMD,
            funcs.DeletePerfMonitorsAMD,
            funcs.SelectPerfMonitorCountersAMD,
            funcs.BeginPerfMonitorAMD,
            funcs.EndPerfMonitorAMD,
            funcs.GetPerfMonitorCounterDataAMD);

    return GL.checkExtension("GL_AMD_performance_monitor", funcs, supported);
  }
コード例 #18
0
ファイル: Main.java プロジェクト: alekseyLymarev/mario
  private void loop() {
    // This line is critical for LWJGL's interoperation with GLFW's
    // OpenGL context, or any context that is managed externally.
    // LWJGL detects the context that is current in the current thread,
    // creates the GLCapabilities instance and makes the OpenGL
    // bindings available for use.
    GL.createCapabilities();

    // Set the clear color
    glClearColor(0.1f, 0.7f, 1.0f, 0.0f);

    // Run the rendering loop until the user has attempted to close
    // the window or has pressed the ESCAPE key.
    while (glfwWindowShouldClose(window) == GLFW_FALSE) {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // clear the framebuffer

      glfwSwapBuffers(window); // swap the color buffers

      // Poll for window events. The key callback above will only be
      // invoked during this call.
      glfwPollEvents();
    }
  }
コード例 #19
0
 /** Returns the {@link ARBViewportArray} instance for the current context. */
 public static ARBViewportArray getInstance() {
   return checkFunctionality(GL.getCapabilities().__ARBViewportArray);
 }
コード例 #20
0
 /** Returns the {@link org.lwjgl.opengl.WGLAMDGPUAssociation} instance for the current context. */
 public static WGLAMDGPUAssociation getInstance() {
   return GL.getCapabilities().__WGLAMDGPUAssociation;
 }
コード例 #21
0
 /** Returns the {@link GL15} instance for the current context. */
 public static GL15 getInstance() {
   return checkFunctionality(GL.getCapabilities().__GL15);
 }
コード例 #22
0
 /** Returns the {@link WGLARBMakeCurrentRead} instance for the current context. */
 public static WGLARBMakeCurrentRead getInstance() {
   return GL.getCapabilities().__WGLARBMakeCurrentRead;
 }
コード例 #23
0
 /** Returns the {@link GL12} instance for the current context. */
 public static GL12 getInstance() {
   return GL.getCapabilities().__GL12;
 }
コード例 #24
0
 /** Returns the {@link ARBTextureBarrier} instance for the current context. */
 public static ARBTextureBarrier getInstance() {
   return checkFunctionality(GL.getCapabilities().__ARBTextureBarrier);
 }
コード例 #25
0
ファイル: WGLNVDXInterop.java プロジェクト: Neogs12/GVue
 /** Returns the {@link WGLNVDXInterop} instance for the current context. */
 public static WGLNVDXInterop getInstance() {
   return GL.getCapabilities().__WGLNVDXInterop;
 }
コード例 #26
0
 /** Returns the {@link ARBCopyImage} instance for the current context. */
 public static ARBCopyImage getInstance() {
   return checkFunctionality(GL.getCapabilities().__ARBCopyImage);
 }
 /** Returns the {@link NVBindlessMultiDrawIndirectCount} instance for the current context. */
 public static NVBindlessMultiDrawIndirectCount getInstance() {
   return checkFunctionality(GL.getCapabilities().__NVBindlessMultiDrawIndirectCount);
 }
コード例 #28
0
 /** Returns the {@link GLXAMDGPUAssociation} instance for the current context. */
 public static GLXAMDGPUAssociation getInstance() {
   return checkFunctionality(GL.getCapabilities().__GLXAMDGPUAssociation);
 }
コード例 #29
0
 /** Returns the {@link WGLNVGPUAffinity} instance of the current context. */
 public static WGLNVGPUAffinity getInstance() {
   return getInstance(GL.getCapabilities());
 }
コード例 #30
0
 /** Returns the {@link EXTTextureInteger} instance for the current context. */
 public static EXTTextureInteger getInstance() {
   return checkFunctionality(GL.getCapabilities().__EXTTextureInteger);
 }