I am now learning OpenTK. I have some trouble learning how buffers, vectors and how to make more than 2 3d shapes.
and if I try to set the texture or shaders, it will change all the shapes to the same textures and shaders.

I have read a lot of tutorials.
here are some list of tutorials that I have seen and read about it:

https://github.com/opentk/LearnOpenTK
https://github.com/giawa/opengl4tutorials
https://www.youtube.com/playlist?list=PLWzp0Bbyy_3ggUK3XZjBmwnSjhbhJH3kp
https://github.com/eowind/dreamstatecoding
http://dreamstatecoding.blogspot.com/2017/01/opengl-4-with-opentk-in-c-part-1.html
https://opentk.net/learn/index.html
http://www.siltutorials.com/opentkbasicsindex

how can I give these 2 triangles different shaders or/and textures.

```c#
            GL.Color4(0.4, 0.6, 0.1, 1.0);
            GL.Begin(PrimitiveType.Triangles);
            GL.Vertex2(0, 0);
            GL.Vertex2(1, 0);
            GL.Vertex2(0, 1);
            GL.End();

            GL.Color4(0.4, 0.2, 0.1, 1.0);
            GL.Begin(PrimitiveType.Triangles);
            GL.Vertex2(0, 0);
            GL.Vertex2(-1, 0);
            GL.Vertex2(0, -1);
            GL.End();
```

Here is my full code, I have 2 classes in my namespace

Program.cs

using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
using System;
using System.Drawing;

namespace obamaExperimentingV1_14
{
    public class ObamaBattlezCSharp : GameWindow
    { 
        private static void Main(string[] args)
        {
            using (var window = new Window(1280, 720, GraphicsMode.Default, "Obama Battlez CSharp Version", GameWindowFlags.Default, DisplayDevice.Default)) {
                //window.Icon = new Icon("Resources/bruhstar (1).bmp");
                window.Run(60.0f);
            }
        }
    }
}

Window.cs

using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
using System;
using System.Drawing;

namespace obamaExperimentingV1_14
{
    class Window : GameWindow
    {

        public Window(int width, int height, GraphicsMode graphicsMode, string title, GameWindowFlags gameWindowFlags, DisplayDevice displayDevice)
            : base(width, height, GraphicsMode.Default, title, GameWindowFlags.Default, displayDevice)
        {

        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            GL.ClearColor(0.5f, 0.6f, 0.7f, 1.0f);
        }

        protected override void OnUpdateFrame(FrameEventArgs e)
        {
            base.OnUpdateFrame(e);

            var input = Keyboard.GetState();

            if (input.IsKeyDown(Key.Escape)) {
                Exit();
            }

            base.OnUpdateFrame(e);

        }

        protected override void OnRenderFrame(FrameEventArgs e)
        {
            base.OnRenderFrame(e);
            GL.Clear(ClearBufferMask.ColorBufferBit);

            GL.Color4(0.4, 0.6, 0.1, 1.0);
            GL.Begin(PrimitiveType.Triangles);
            GL.Vertex2(0, 0);
            GL.Vertex2(1, 0);
            GL.Vertex2(0, 1);
            GL.End();

            GL.Color4(0.4, 0.2, 0.1, 1.0);
            GL.Begin(PrimitiveType.Triangles);
            GL.Vertex2(0, 0);
            GL.Vertex2(-1, 0);
            GL.Vertex2(0, -1);
            GL.End();

            SwapBuffers();
        }

        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);
            GL.Viewport(0, 0, Width, Height);
        }

        protected override void OnUnload(EventArgs e)
        {
            base.OnUnload(e);
        }
    }
}

btw, if someones knows how to change the icon of the window, then tell me how, I am really curious how to set the icon for the window.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.