4 @SuppressWarnings public class QOpenGLWidget : QWidget{
5 onOpenGLEventListener _listener = nilptr;
7 public enum UpdateBehavior {
20 nativehandle = QtXnl.createQObject(QType.qtOpenGLWidget,
this, 0);
21 if (nativehandle == 0) {
27 public bool create(@NotNilptr QWidget parent) {
28 nativehandle = QtXnl.createQObject(QType.qtOpenGLWidget,
this, parent.nativehandle);
29 if (nativehandle == 0) {
36 QtXnl.widget_set_vint_value(nativehandle, Constant.QOPENGLWIDGET_SETUPDATEBEHAVIOR, updateBehavior);
40 return (UpdateBehavior)QtXnl.widget_get_int_value(nativehandle, Constant.QOPENGLWIDGET_UPDATEBEHAVIOR);
44 QtXnl.widget_set_native_value(nativehandle, Constant.QOPENGLWIDGET_SETFORMAT, format.nativehandle);
48 return new QSurfaceFormat(QtXnl.long_get(nativehandle, Constant.QOPENGLWIDGET_FORMAT));
52 return QtXnl.widget_get_bool_value(nativehandle, Constant.QOPENGLWIDGET_ISVALID);
56 QtXnl.widget_slot(nativehandle, Constant.QOPENGLWIDGET_MAKECURRENT);
60 QtXnl.widget_slot(nativehandle, Constant.QOPENGLWIDGET_DONECURRENT);
64 return (QOpenGLContext)(QtXnl.widget_get_object(nativehandle, Constant.QOPENGLWIDGET_CONTEXT));
68 return QtXnl.widget_get_int_value(nativehandle, Constant.QOPENGLWIDGET_DEFAULTFRAMEBUFFEROBJECT);
72 return new QImage(QtXnl.long_get(nativehandle, Constant.QOPENGLWIDGET_GRABFRAMEBUFFER));
84 if (_listener != nilptr){
85 _listener.aboutToCompose(
this);
89 if (_listener != nilptr){
90 _listener.frameSwapped(
this);
94 if (_listener != nilptr){
95 _listener.aboutToResize(
this);
99 if (_listener != nilptr){
100 _listener.resized(
this);
105 if (_listener != nilptr){
106 _listener.initializeGL(
this);
110 if (_listener != nilptr){
111 _listener.resizeGL(
this, w, h);
115 if (_listener != nilptr){
116 _listener.paintGL(
this);