/*******************************************************************************
 * Copyright (c) 2000, 2020 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *    IBM Corporation - initial API and implementation
 *******************************************************************************/

/* Note: This file was auto-generated by org.eclipse.swt.tools.internal.JNIGenerator */
/* DO NOT EDIT - your changes will be lost. */

#include "swt.h"
#include "wgl_structs.h"
#include "wgl_stats.h"

#ifndef WGL_NATIVE
#define WGL_NATIVE(func) Java_org_eclipse_swt_internal_opengl_win32_WGL_##func
#endif

#ifndef NO_ChoosePixelFormat
JNIEXPORT jint JNICALL WGL_NATIVE(ChoosePixelFormat)
	(JNIEnv *env, jclass that, jlong arg0, jobject arg1)
{
	PIXELFORMATDESCRIPTOR _arg1, *lparg1=NULL;
	jint rc = 0;
	WGL_NATIVE_ENTER(env, that, ChoosePixelFormat_FUNC);
	if (arg1) if ((lparg1 = getPIXELFORMATDESCRIPTORFields(env, arg1, &_arg1)) == NULL) goto fail;
	rc = (jint)ChoosePixelFormat((HDC)arg0, lparg1);
fail:
	WGL_NATIVE_EXIT(env, that, ChoosePixelFormat_FUNC);
	return rc;
}
#endif

#ifndef NO_DescribePixelFormat
JNIEXPORT jint JNICALL WGL_NATIVE(DescribePixelFormat)
	(JNIEnv *env, jclass that, jlong arg0, jint arg1, jint arg2, jobject arg3)
{
	PIXELFORMATDESCRIPTOR _arg3, *lparg3=NULL;
	jint rc = 0;
	WGL_NATIVE_ENTER(env, that, DescribePixelFormat_FUNC);
	if (arg3) if ((lparg3 = &_arg3) == NULL) goto fail;
	rc = (jint)DescribePixelFormat((HDC)arg0, arg1, arg2, lparg3);
fail:
	if (arg3 && lparg3) setPIXELFORMATDESCRIPTORFields(env, arg3, lparg3);
	WGL_NATIVE_EXIT(env, that, DescribePixelFormat_FUNC);
	return rc;
}
#endif

#ifndef NO_SetPixelFormat
JNIEXPORT jboolean JNICALL WGL_NATIVE(SetPixelFormat)
	(JNIEnv *env, jclass that, jlong arg0, jint arg1, jobject arg2)
{
	PIXELFORMATDESCRIPTOR _arg2, *lparg2=NULL;
	jboolean rc = 0;
	WGL_NATIVE_ENTER(env, that, SetPixelFormat_FUNC);
	if (arg2) if ((lparg2 = getPIXELFORMATDESCRIPTORFields(env, arg2, &_arg2)) == NULL) goto fail;
	rc = (jboolean)SetPixelFormat((HDC)arg0, arg1, lparg2);
fail:
	WGL_NATIVE_EXIT(env, that, SetPixelFormat_FUNC);
	return rc;
}
#endif

#ifndef NO_SwapBuffers
JNIEXPORT jboolean JNICALL WGL_NATIVE(SwapBuffers)
	(JNIEnv *env, jclass that, jlong arg0)
{
	jboolean rc = 0;
	WGL_NATIVE_ENTER(env, that, SwapBuffers_FUNC);
	rc = (jboolean)SwapBuffers((HDC)arg0);
	WGL_NATIVE_EXIT(env, that, SwapBuffers_FUNC);
	return rc;
}
#endif

#ifndef NO_wglCreateContext
JNIEXPORT jlong JNICALL WGL_NATIVE(wglCreateContext)
	(JNIEnv *env, jclass that, jlong arg0)
{
	jlong rc = 0;
	WGL_NATIVE_ENTER(env, that, wglCreateContext_FUNC);
	rc = (jlong)wglCreateContext((HDC)arg0);
	WGL_NATIVE_EXIT(env, that, wglCreateContext_FUNC);
	return rc;
}
#endif

#ifndef NO_wglDeleteContext
JNIEXPORT jboolean JNICALL WGL_NATIVE(wglDeleteContext)
	(JNIEnv *env, jclass that, jlong arg0)
{
	jboolean rc = 0;
	WGL_NATIVE_ENTER(env, that, wglDeleteContext_FUNC);
	rc = (jboolean)wglDeleteContext((HGLRC)arg0);
	WGL_NATIVE_EXIT(env, that, wglDeleteContext_FUNC);
	return rc;
}
#endif

#ifndef NO_wglGetCurrentContext
JNIEXPORT jlong JNICALL WGL_NATIVE(wglGetCurrentContext)
	(JNIEnv *env, jclass that)
{
	jlong rc = 0;
	WGL_NATIVE_ENTER(env, that, wglGetCurrentContext_FUNC);
	rc = (jlong)wglGetCurrentContext();
	WGL_NATIVE_EXIT(env, that, wglGetCurrentContext_FUNC);
	return rc;
}
#endif

#ifndef NO_wglMakeCurrent
JNIEXPORT jboolean JNICALL WGL_NATIVE(wglMakeCurrent)
	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
{
	jboolean rc = 0;
	WGL_NATIVE_ENTER(env, that, wglMakeCurrent_FUNC);
	rc = (jboolean)wglMakeCurrent((HDC)arg0, (HGLRC)arg1);
	WGL_NATIVE_EXIT(env, that, wglMakeCurrent_FUNC);
	return rc;
}
#endif

#ifndef NO_wglShareLists
JNIEXPORT jboolean JNICALL WGL_NATIVE(wglShareLists)
	(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
{
	jboolean rc = 0;
	WGL_NATIVE_ENTER(env, that, wglShareLists_FUNC);
	rc = (jboolean)wglShareLists((HGLRC)arg0, (HGLRC)arg1);
	WGL_NATIVE_EXIT(env, that, wglShareLists_FUNC);
	return rc;
}
#endif

