Matrix mvp;
Matrix projection;
Size2D size;
+ Color worldColor;
Rectangle clippingBox;
ReadOnlyCollection<int> textureBindings;
- public RenderCallbackInput(Matrix mvp, Matrix projection, Size2D size, Rectangle clippingBox, int[] textureBindings)
+ public RenderCallbackInput(Matrix mvp, Matrix projection, Size2D size, Color worldColor, Rectangle clippingBox, int[] textureBindings)
{
this.mvp = mvp;
this.projection = projection;
this.size = size;
+ this.worldColor = worldColor;
this.clippingBox = clippingBox;
this.textureBindings = new ReadOnlyCollection<int>(textureBindings);
}
get { return size; }
}
+ /// <summary>
+ /// The World color of the DirectRenderingGLView
+ /// </summary>
+ public Color WorldColor
+ {
+ get { return worldColor; }
+ }
+
/// <summary>
/// The area of DirectRenderingGLView. You can use this for glScissor()
/// </summary>
Matrix mvp = Matrix.GetMatrixFromPtr(Interop.GLView.GlViewGetRednerCallbackInputMvp(cPtr));
Matrix projection = Matrix.GetMatrixFromPtr(Interop.GLView.GlViewGetRednerCallbackInputProjection(cPtr));
Size2D size = Size2D.GetSize2DFromPtr(Interop.GLView.GlViewGetRednerCallbackInputSize(cPtr), false);
+ Color worldColor = Color.GetColorFromPtr(Interop.GLView.GlViewGetRednerCallbackInputWorldColor(cPtr));
Rectangle clippingBox = Rectangle.GetRectangleFromPtr(Interop.GLView.GlViewGetRednerCallbackInputClipplingBox(cPtr), false);
int[] textureBindings = GetTextureBindings(cPtr);
- RenderCallbackInput input = new RenderCallbackInput(mvp, projection, size, clippingBox, textureBindings);
+ RenderCallbackInput input = new RenderCallbackInput(mvp, projection, size, worldColor, clippingBox, textureBindings);
return glRenderFrameCallback(input);
}
[global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "getAngle")]
public static extern int getAngle();
+ [global::System.Runtime.InteropServices.DllImport(lib, EntryPoint = "setWorldColor")]
+ public static extern int setWorldColor(float r, float g, float b, float a);
+
private string TAG = "NUIDRGLVIEW";
private DirectRenderingGLView glView;
private int mNumTouched = 0;
+ private Animation opacityAnimation;
+
protected override void OnCreate()
{
base.OnCreate();
layoutView.Add(glViewLayout);
layoutView.Add(textButton);
+ opacityAnimation = new Animation(10000);
+ opacityAnimation.LoopingMode = Animation.LoopingModes.AutoReverse;
+ opacityAnimation.Looping = true;
+ opacityAnimation.AnimateTo(layoutView, "Opacity", 0.25f, new AlphaFunction(AlphaFunction.BuiltinFunctions.EaseInOutSine));
+ opacityAnimation.Play();
+
LoadTexture();
TextLabel labelz = new TextLabel("Hello World!");
log.Error(TAG, $" Window Rotated? : {isRotated}\n");
log.Error(TAG, $" Window PositionSize : {localWindowPositionSize.X},{localWindowPositionSize.Y} : {localWindowPositionSize.Width}x{localWindowPositionSize.Height}\n");
log.Error(TAG, $" Size : {input.Size.Width}, {input.Size.Height}\n");
+ log.Error(TAG, $" WorldColor : {input.WorldColor.R}, {input.WorldColor.G} {input.WorldColor.B} {input.WorldColor.A}\n");
log.Error(TAG, $" Clipping : {input.ClippingBox.X},{input.ClippingBox.Y} : {input.ClippingBox.Width}x{input.ClippingBox.Height}\n");
// Note that we should use view port position always (0,0), since it depend on window size
setViewport(0, 0, localWindowPositionSize.Width, localWindowPositionSize.Height);
setSize(input.Size.Width, input.Size.Height);
+ setWorldColor(input.WorldColor.R, input.WorldColor.G, input.WorldColor.B, input.WorldColor.A);
// Note that input.ClippingBox's (0,0) is left-bottom of window (not include rotation!).
// And glScissor need to (0,0) is left-bottom of window (not include rotation!).
{
textButton.TextLabel.Text = "Start";
glView.RenderingMode = GLRenderingMode.OnDemand;
+ opacityAnimation.Pause();
}
else
{
textButton.TextLabel.Text = "Stop";
glView.RenderingMode = GLRenderingMode.Continuous;
+ opacityAnimation.Play();
}
}