giawa / opengl4csharp

OpenGL 4 Bindings (partially based on OpenTK) for C#
Other
234 stars 61 forks source link

rendering more than one shape with out writing them separately #38

Closed RinzuTheCoder closed 4 years ago

RinzuTheCoder commented 4 years ago

How do you render more than on shape with out writing them out separately like in the tutorial. I made a class to handle what you wrote out manually for each shape and it does not work only one shape shows in the window. I am trying to eventually fill the whole window with baby blue textures as a background with an algorithm. I dont see that possible.

Shape2d image

Shapefactory image

draw shape image

draw shapes image

createDisplay

More than one shape

giawa commented 4 years ago

Do you mind dropping the code into a project that I can run to reproduce it? Something like a gist or a project in github would be perfect.

RinzuTheCoder commented 4 years ago

I tried making a dll for my backend and the project broke. Im trying to generate multiple shapes at once and only one renders. if you can please try and create two triangles in a switch, and a foreach loop to draw each one like the snippets below. you may have to create a class to hold all the VBOs, vertices and elements. Its should recreate the problem.

Note: I dont want to create a colored background writing out each shape in the thread like your tutorial

draw shape image

draw shapes image

giawa commented 4 years ago

Sorry, all of these images don't help me much, unfortunately. I would have to retype everything in them to try to debug the program. Can you please share this as some sort of project/repository/etc?

giawa commented 4 years ago

Closing for inactivity - if you would like to reopen, please supply the code in a format I can easily compile so that I can help. Thanks!