Jemy191
Jemy191
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Thanks
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Ex:
handle = this.gl.GenVertexArray();
Bind();
vbo.Bind();
ebo.Bind();
handle = this.gl.GenVertexArray();
Bind();
vbo.Bind();
ebo.Bind();
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Yeah it pretty hard sometime XD. It kinda work in my engine now 🙂 My abstraction was making thing out of order😅 Little question should I not be able to create the vbo and vbo prior to creating the vao and just rebinding the vbo and vbo after the vao?
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Sometime it so simple and obvious that you don't think of it 🤣
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Thanks for pointing me the obvious 😅 The tutorial code work. I started my project so long ago that I was thinking I did the basic stuff right🙃
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Omg yes I follow it a while ago. I want thinking there was no use of Ebo. I'll do that real quick
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Il add a shader to see if it help in any way
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
But if I use DrawArrays it work and I have a black triangle🙃
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
yes
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
So gen bind enable and Set pointer? It wont work either
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
So you said: Gen and bind the vertexArray, Gend, bind and send vertBuffer and gen, bind and send indexBuffer. Right? it wont work using the (void*) 0 too
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Yeah if I use (void*) 0 with DrawElement it throw but with UIntPtr.Zero it just do not draw🙃
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
that was thowing me off XD
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Me too
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Really weird that it won't work. I must be missing some little simple thing.
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
No description
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
No description
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
Also when I use (void*)0 instead of UIntPtr.Zero in DrawElement it throw this: System.ExecutionEngineException
34 replies
SSilk.NET
Created by Jemy191 on 12/19/2024 in #help-and-questions
Hello I dont know why but I seem to be
using Silk.NET.OpenGL;
using Silk.NET.Windowing;
using System.Drawing;

GL gl = null!;

var options = WindowOptions.Default;
options.Size = new Silk.NET.Maths.Vector2D<int>(800, 600);
options.Title = "Silk.NET OpenGL Triangle";

var window = Window.Create(options);

window.Load += OnLoad;
window.Render += OnRender;
window.Run();
return;

unsafe void OnLoad()
{
gl = GL.GetApi(window);
gl.ClearColor(Color.CornflowerBlue);

Span<uint> indices = [0, 1, 2];
Span<float> vertices =
[
0.0f, 0.5f, 0.0f,
-0.5f, -0.5f, 0.0f,
0.5f, -0.5f, 0.0f
];

var vertexBuffer = gl.GenBuffer();
gl.BindBuffer(BufferTargetARB.ArrayBuffer, vertexBuffer);

fixed (void* d = vertices) { gl.BufferData(BufferTargetARB.ArrayBuffer, (nuint)(vertices.Length * sizeof(float)), d, BufferUsageARB.StaticDraw); }

var indexBuffer = gl.GenBuffer();
gl.BindBuffer(BufferTargetARB.ElementArrayBuffer, indexBuffer);

fixed (void* d = indices) { gl.BufferData(BufferTargetARB.ElementArrayBuffer, (nuint)(indices.Length * sizeof(uint)), d, BufferUsageARB.StaticDraw); }

var vertexArray = gl.GenVertexArray();
gl.BindVertexArray(vertexArray);
gl.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, false, 3 * sizeof(float), IntPtr.Zero);
gl.EnableVertexAttribArray(0);
}

void OnRender(double delta)
{
gl.Clear((uint)ClearBufferMask.ColorBufferBit);
gl.DrawElements(PrimitiveType.Triangles, 3, DrawElementsType.UnsignedInt, UIntPtr.Zero);
}
using Silk.NET.OpenGL;
using Silk.NET.Windowing;
using System.Drawing;

GL gl = null!;

var options = WindowOptions.Default;
options.Size = new Silk.NET.Maths.Vector2D<int>(800, 600);
options.Title = "Silk.NET OpenGL Triangle";

var window = Window.Create(options);

window.Load += OnLoad;
window.Render += OnRender;
window.Run();
return;

unsafe void OnLoad()
{
gl = GL.GetApi(window);
gl.ClearColor(Color.CornflowerBlue);

Span<uint> indices = [0, 1, 2];
Span<float> vertices =
[
0.0f, 0.5f, 0.0f,
-0.5f, -0.5f, 0.0f,
0.5f, -0.5f, 0.0f
];

var vertexBuffer = gl.GenBuffer();
gl.BindBuffer(BufferTargetARB.ArrayBuffer, vertexBuffer);

fixed (void* d = vertices) { gl.BufferData(BufferTargetARB.ArrayBuffer, (nuint)(vertices.Length * sizeof(float)), d, BufferUsageARB.StaticDraw); }

var indexBuffer = gl.GenBuffer();
gl.BindBuffer(BufferTargetARB.ElementArrayBuffer, indexBuffer);

fixed (void* d = indices) { gl.BufferData(BufferTargetARB.ElementArrayBuffer, (nuint)(indices.Length * sizeof(uint)), d, BufferUsageARB.StaticDraw); }

var vertexArray = gl.GenVertexArray();
gl.BindVertexArray(vertexArray);
gl.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, false, 3 * sizeof(float), IntPtr.Zero);
gl.EnableVertexAttribArray(0);
}

void OnRender(double delta)
{
gl.Clear((uint)ClearBufferMask.ColorBufferBit);
gl.DrawElements(PrimitiveType.Triangles, 3, DrawElementsType.UnsignedInt, UIntPtr.Zero);
}
34 replies