Reputation: 1804
I've been trying to draw some OpenGL graphics on a live card, but keep getting the following error message.
According to https://developers.google.com/glass/design/ui/live-cards, high-frequency live card "renders many times a second and can show rich 3D or 2D content." I'm able to render 2D Canvas content on both high-frequency live card and immersion, and OpenGL on immersion. In immersion, two lines of code inside an Activity's onCreate can start rendering OpenGL:
view3D = new MyGLView(this);
setContentView(view3D);
In live card, I tried:
mCallback3D = new MyGLView(this);
mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_ID);
mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(mCallback3D);
Is it possible to render OpenGL on a live card at all? Basically, how to render OpenGL without using Activity?
Upvotes: 2
Views: 838
Reputation: 21
XE16 includes a GlRenderer class for using OpenGL ES on Live cards. The sample code is here: https://developers.google.com/glass/develop/gdk/live-cards#using_opengl
Upvotes: 1