2017-08-03 4 views
0

LWJGLとOpenGLの使用を開始したばかりで、問題が発生しました。私が見つけたゲームエンジンを使って作っているゲームの単純な線を描く方法を見つけようとしています。LWJGL - 現在のコンテキストでは使用できない関数が呼び出されました

これは私が使用しているエンジンへのリンクです:私はこの機能を追加しようとしたレンダラークラスでhttps://github.com/SilverTiger/SilenceEngine

を -

public void drawLine(Point point, Point point2) { 

     GL11.glColor3f(0.0f, 1.0f, 0.2f); 
     GL11.glBegin(GL11.GL_LINES); 
     GL11.glVertex2d(point.x, point.y); 
     GL11.glVertex2d(point2.x, point2.y); 
     GL11.glEnd(); 

} 

次のように私が手にエラーがある:

# 
# A fatal error has been detected by the Java Runtime Environment: 
# 
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007fff32b524cd, pid=3016, tid=0x0000000000002548 
# 
# JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11) 
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode windows-amd64 compressed oops) 
# Problematic frame: 
# C [lwjgl.dll+0x124cd] 
# 
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows 
# 
# An error report file with more information is saved as: 
# C:\Users\sambu\workspace\NextGen Engine - 0.3.1\hs_err_pid3016.log 
# 
# If you would like to submit a bug report, please visit: 
# http://bugreport.java.com/bugreport/crash.jsp 
# The crash happened outside the Java Virtual Machine in native code. 
# See problematic frame for where to report the bug. 
# 
[LWJGL] A function that is not available in the current context was called. The JVM will abort execution. Inspect the crash log to find the responsible Java frames. 

私はこれに非常に新しいので、これを修正する方法がわかりません。

答えて

0

エンジンで作成されるウィンドウには、バージョン3.2のOpenGLコンテキストがあります。バージョン3.2では、古い、初期の描画呼び出しを呼び出すことはできません。すべての描画呼び出しは、頂点配列とバッファで行う必要があります。ここではこれを行う方法のチュートリアルです(これはC++で書かれています)。Draw Your First Triangle。ここでは始動に関するエンジンのフォーラム(初心者質問と呼ばれます)があります。 Forum

関連する問題