ورود

View Full Version : ایراد در برنامه



ahmaduse
دوشنبه 16 دی 1392, 15:13 عصر
آقا من این برنامه رو کدش رو میزارم لطفا یکی دانلودش کنه بگه ایرادش کجاست
یه برنامه فوق مبتدیه فقط چارتا خط میخوام رسم کنم
اما شکل تو خروجی نمیاد
لطفا یکی راهنمایی کنه




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;

namespace WindowsFormsApplication12
{
public partial class Form1 : Form
{

int x;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void glControl1_Load(object sender, EventArgs e)
{

int w = glControl1.Width;
int h = glControl1.Height;
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
GL.Ortho(0, w, 0, h, -1, 1); // Bottom-left corner pixel has coordinate (0, 0)
GL.Viewport(0, 0, w, h);

}

private void glControl1_Resize(object sender, EventArgs e)
{
}

private void glControl1_Paint(object sender, PaintEventArgs e)
{


x = glControl1.Left;
int h = glControl1.Height;

GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
GL.MatrixMode(MatrixMode.Modelview);
GL.LoadIdentity();


GL.Begin(BeginMode.LineLoop);
GL.Color3(Color.Red);
GL.Vertex2(x, h+11);
GL.Vertex2(x+11, h+33);
GL.Vertex2(x+20, h+50);
GL.End();

glControl1.SwapBuffers();
}
}


}




یک کنترل glcontrol روی فرم گذاشتم
openTK و openTK.GLControl رو هو تو refrence اتچ کردم
اما خروجی نداره
یکی کمک کنه خواهشا این رو برام اصلاح کنه

ahmaduse
سه شنبه 17 دی 1392, 11:23 صبح
کسی راهنماییم نمیکنه؟؟؟؟؟؟؟