开发者

How to set initial window size in Java OpenGL

I just built a Java OpenGL application in Eclipse... and when i was trying to export the application using EclipseP5Exporter, it requires me to initialize the window size (not viewport size, a window may contain several vie开发者_运维知识库wports).

I already googled some solutions in the net but I can't seem to get anything useful..

I've tried the method: glutInitWindowSize(int width, int height);

but it seems to work only in C and python openGL.

even if i append the glut before the method (glut.glutInitWindowSize()) eclipse doesn't recognize that method..

So if you guys have any suggestions please let me know...

Thank you....


I'm guessing by "Java OpenGL" you mean JOGL.

If this is the case, then you have either a GLCanvas or GLJPanel. Either of these should be inside a awt Frame or swing JFrame. Both of these inherit from awt.Window, which has the setSize(int,int) method.

In short, use the setSize method of your Frame or JFrame.

JOGL's implementation of GLUT only includes the drawing functions, not window management functions. Window creation is handled by Java via AWT or Swing. You might want to learn more about Java if you aren't familiar with these concepts.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜