001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: /**
018: * @author Oleg V. Khaschansky
019: * @version $Revision$
020: */package org.apache.harmony.awt.nativebridge.linux;
021:
022: import org.apache.harmony.awt.nativebridge.*;
023:
024: /**
025: * This file is based on GLX header and has been generated by the nativebridge tool.
026: */
027: public class GLX extends BasicLibWrapper {
028: static GLX instance;
029:
030: public static synchronized GLX getInstance() {
031: if (instance == null) {
032: instance = new GLX();
033: }
034: return instance;
035: }
036:
037: private GLX() {
038: System.loadLibrary("X11Wrapper");
039: init();
040: }
041:
042: private static native void init();
043:
044: public final int glXQueryExtension(long dpy,
045: Int32Pointer error_base, Int32Pointer event_base) {
046: long tmp_0 = error_base == null ? 0 : error_base
047: .longLockPointer();
048: long tmp_1 = event_base == null ? 0 : event_base
049: .longLockPointer();
050: int tmp_ret = glXQueryExtension(dpy, tmp_0, tmp_1);
051: if (error_base != null) {
052: error_base.unlock();
053: }
054: if (event_base != null) {
055: event_base.unlock();
056: }
057: return tmp_ret;
058: }
059:
060: public final native int glXQueryExtension(long dpy,
061: long error_base, long event_base);
062:
063: public final int glXGetFBConfigAttrib(long dpy, long config,
064: int attribute, Int32Pointer value) {
065: long tmp_0 = value == null ? 0 : value.longLockPointer();
066: int tmp_ret = glXGetFBConfigAttrib(dpy, config, attribute,
067: tmp_0);
068: if (value != null) {
069: value.unlock();
070: }
071: return tmp_ret;
072: }
073:
074: public final native int glXGetFBConfigAttrib(long dpy, long config,
075: int attribute, long value);
076:
077: public final native long glXCreateNewContext(long dpy, long config,
078: int render_type, long share_list, int direct);
079:
080: public final native int glXMakeCurrent(long dpy, long drawable,
081: long ctx);
082:
083: public final native void glXDestroyContext(long dpy, long ctx);
084:
085: public final native void glXDestroyPbuffer(long dpy, long pbuf);
086:
087: public final PointerPointer glXChooseFBConfig(long dpy, int screen,
088: Int32Pointer attrib_list, Int32Pointer nelements) {
089: long tmp_0 = attrib_list == null ? 0 : attrib_list
090: .longLockPointer();
091: long tmp_1 = nelements == null ? 0 : nelements
092: .longLockPointer();
093: long tmp_ret = glXChooseFBConfig(dpy, screen, tmp_0, tmp_1);
094: if (attrib_list != null) {
095: attrib_list.unlock();
096: }
097: if (nelements != null) {
098: nelements.unlock();
099: }
100: return nb.createPointerPointer(tmp_ret);
101: }
102:
103: public final native long glXChooseFBConfig(long dpy, int screen,
104: long attrib_list, long nelements);
105:
106: public final long glXCreatePbuffer(long dpy, long config,
107: Int32Pointer attrib_list) {
108: long tmp_0 = attrib_list == null ? 0 : attrib_list
109: .longLockPointer();
110: long tmp_ret = glXCreatePbuffer(dpy, config, tmp_0);
111: if (attrib_list != null) {
112: attrib_list.unlock();
113: }
114: return tmp_ret;
115: }
116:
117: public final native long glXCreatePbuffer(long dpy, long config,
118: long attrib_list);
119:
120: public final native void glXSwapBuffers(long dpy, long drawable);
121:
122: public final native int glXMakeContextCurrent(long display,
123: long draw, long read, long ctx);
124:
125: }
|