2008-08-19 18:46:03 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2002-2008 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.opengl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* An implementation of ContextAttribs using WGL_create_context.
|
|
|
|
|
*
|
|
|
|
|
* @author spasi <spasi@users.sourceforge.net>
|
|
|
|
|
*/
|
2008-08-19 19:47:24 +02:00
|
|
|
final class WindowsContextAttribs implements ContextAttribsImplementation {
|
2008-08-19 18:46:03 +02:00
|
|
|
|
|
|
|
|
private static final int WGL_CONTEXT_MAJOR_VERSION_ARB = 0x2091;
|
|
|
|
|
private static final int WGL_CONTEXT_MINOR_VERSION_ARB = 0x2092;
|
2011-09-03 20:52:45 +02:00
|
|
|
private static final int WGL_CONTEXT_LAYER_PLANE_ARB = 0x2093;
|
|
|
|
|
private static final int WGL_CONTEXT_FLAGS_ARB = 0x2094;
|
|
|
|
|
private static final int WGL_CONTEXT_PROFILE_MASK_ARB = 0x9126;
|
2008-08-19 18:46:03 +02:00
|
|
|
|
2011-09-03 20:52:45 +02:00
|
|
|
private static final int WGL_CONTEXT_DEBUG_BIT_ARB = 0x0001;
|
2008-08-19 18:46:03 +02:00
|
|
|
private static final int WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x0002;
|
|
|
|
|
|
2011-09-03 20:52:45 +02:00
|
|
|
private static final int WGL_CONTEXT_CORE_PROFILE_BIT_ARB = 0x00000001;
|
Added support for OpenGL 3.2 and the following extensions: AMD_draw_buffers_blend, ARB_depth_clamp, ARB_draw_buffers_blend, ARB_draw_elements_base_vertex, ARB_fragment_coord_conventions, ARB_provoking_vertex, ARB_sample_shading, ARB_seamless_cube_map, ARB_shader_texture_lod, ARB_texture_cube_map_array, ARB_texture_gather, ARB_texture_multisample, ARB_texture_query_lod, ARB_vertex_array_bgra, EXT_separate_shader_objects, EXT_texture_snorm, NV_copy_image, NV_parameter_buffer_object2.
2009-08-04 20:21:41 +02:00
|
|
|
private static final int WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x00000002;
|
|
|
|
|
|
2008-08-19 19:47:24 +02:00
|
|
|
WindowsContextAttribs() {
|
2008-08-19 18:46:03 +02:00
|
|
|
}
|
|
|
|
|
|
2008-08-19 19:47:24 +02:00
|
|
|
public int getMajorVersionAttrib() {
|
2008-08-19 18:46:03 +02:00
|
|
|
return WGL_CONTEXT_MAJOR_VERSION_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-19 19:47:24 +02:00
|
|
|
public int getMinorVersionAttrib() {
|
2008-08-19 18:46:03 +02:00
|
|
|
return WGL_CONTEXT_MINOR_VERSION_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-19 19:47:24 +02:00
|
|
|
public int getLayerPlaneAttrib() {
|
2008-08-19 18:46:03 +02:00
|
|
|
return WGL_CONTEXT_LAYER_PLANE_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-19 19:47:24 +02:00
|
|
|
public int getFlagsAttrib() {
|
2008-08-19 18:46:03 +02:00
|
|
|
return WGL_CONTEXT_FLAGS_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-19 19:47:24 +02:00
|
|
|
public int getDebugBit() {
|
2008-08-19 18:46:03 +02:00
|
|
|
return WGL_CONTEXT_DEBUG_BIT_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-19 19:47:24 +02:00
|
|
|
public int getForwardCompatibleBit() {
|
2008-08-19 18:46:03 +02:00
|
|
|
return WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
Added support for OpenGL 3.2 and the following extensions: AMD_draw_buffers_blend, ARB_depth_clamp, ARB_draw_buffers_blend, ARB_draw_elements_base_vertex, ARB_fragment_coord_conventions, ARB_provoking_vertex, ARB_sample_shading, ARB_seamless_cube_map, ARB_shader_texture_lod, ARB_texture_cube_map_array, ARB_texture_gather, ARB_texture_multisample, ARB_texture_query_lod, ARB_vertex_array_bgra, EXT_separate_shader_objects, EXT_texture_snorm, NV_copy_image, NV_parameter_buffer_object2.
2009-08-04 20:21:41 +02:00
|
|
|
public int getProfileMaskAttrib() {
|
|
|
|
|
return WGL_CONTEXT_PROFILE_MASK_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getProfileCoreBit() {
|
|
|
|
|
return WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getProfileCompatibilityBit() {
|
|
|
|
|
return WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
|
|
|
|
|
}
|
|
|
|
|
|
2008-08-19 18:46:03 +02:00
|
|
|
}
|