Rev 801 |
Rev 818 |
Go to most recent revision |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tao.OpenGl;
using BauzoidNET.app;
using System.IO;
namespace BauzoidEdit
{
public partial class MainForm
: Form
{
private BauzoidApp mApp
= null;
private BauzoidNET
.graphics.sprite.Sprite mSprite
= null;
public MainForm
()
{
InitializeComponent
();
}
private void MainForm_Load
(object sender, EventArgs e
)
{
mApp
= new BauzoidApp
();
mApp
.init();
mSprite
= new BauzoidNET
.graphics.sprite.Sprite(mApp
.getGraphics(),
"data/textures/test.png");
mSprite
.init(10,
10,
300,
300,
0,
0);
}
private void MainForm_FormClosing
(object sender, FormClosingEventArgs e
)
{
if (mSprite
!= null)
{
mSprite
.dispose();
mSprite
= null;
}
if (mApp
!= null)
mApp
.exit();
}
private void mGlView_Paint
(object sender, PaintEventArgs e
)
{
mApp
.getGraphics().clear(0, 0
.5f, 0
.3f,
0);
Gl
.glViewport(0,
0, mGlView
.Width, mGlView
.Height);
mApp
.getRenderStates().projection.setOrtho(
0
.0f,
800,
480,
0
.0f,
0
.0f,
1
.0f
);
/*Gl.glClearColor(1, 1, 1, 1);
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
Gl.glBegin(Gl.GL_TRIANGLES);
Gl.glColor3f(1, 0, 0);
Gl.glVertex2f(-1, -1);
Gl.glColor3f(0, 1, 0);
Gl.glVertex2f(1, -1);
Gl.glColor3f(0, 0, 1);
Gl.glVertex2f(0, 1);
Gl.glEnd();*/
mSprite
.render();
}
}
}