public class Example : MonoBehaviour { // Draw red a rombus on the screen // and also draw a small cyan Quad in the left corner Material mat; void OnPostRender() { if (!mat) { Debug.LogError("Please Assign a material on the inspector"); return; } GL.PushMatrix(); mat.SetPass(...
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { public Material mat; void OnPostRender() { if (!mat) { Debug.LogError("Please Assign a material on the inspector"); return; } GL.PushMatrix(); mat.SetPass(0); GL.LoadOrtho(); GL.Begin(GL.QUADS);...
(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); // 创建窗口 GLFWwindow* window = glfwCreateWindow(800, 600, "OpenGL Quad Example", NULL, NULL); if (!window) { std::cerr << "Failed to create GLFW window" << std::endl; glfwTerminate(); return -1; } glfwMakeContext...
GL_TRIANGLES: return count % 3 == 0; case GL11.GL_LINE: return count % 2 == 0; } return false; } Example 6Source File: BakedQuadVertexBuilder.java From CodeChickenLib with GNU Lesser General Public License v2.1 4 votes public BakedQuadVertexBuilder() { this(GL11.GL_QUADS); } ...
publicclassExampleClass:MonoBehaviour{publicMaterialmat;voidOnPostRender(){if(!mat) {Debug.LogError("Please Assign a material on the inspector");return; }GL.PushMatrix(); mat.SetPass(0);GL.LoadOrtho();GL.Begin(GL.QUADS);GL.Color(Color.red);GL.Vertex3(0,0.5F,0);GL.Vertex3(0.5F,1,0...
public class Example : MonoBehaviour { // Draw red a rombus on the screen // and also draw a small cyan Quad in the left corner Material mat; void OnPostRender() { if (!mat) { Debug.LogError("Please Assign a material on the inspector"); return; } GL.PushMatrix(); mat.SetPass(...
public class Example : MonoBehaviour { // Draw red a rombus on the screen // and also draw a small cyan Quad in the left corner Material mat; void OnPostRender() { if (!mat) { Debug.LogError("Please Assign a material on the inspector"); return; } GL.PushMatrix(); mat.SetPass(...
public class ExampleClass : MonoBehaviour { public Material mat; void OnPostRender() { if (!mat) { Debug.LogError("Please Assign a material on the inspector"); return; } GL.PushMatrix(); mat.SetPass(0); GL.LoadOrtho(); GL.Begin(GL.QUADS); GL.Color(Color.red); GL.Vertex3(0, ...
public class ExampleClass :MonoBehaviour{ publicMaterialmat; void OnPostRender() { if (!mat) {Debug.LogError("Please Assign a material on the inspector"); return; }GL.PushMatrix(); mat.SetPass(0);GL.LoadOrtho();GL.Begin(GL.QUADS);GL.Color(Color.red);GL.Vertex3(0, 0.5F, 0);GL.Ve...
public class Example : MonoBehaviour { // Draw red a rombus on the screen // and also draw a small cyan Quad in the left corner Material mat; void OnPostRender() { if (!mat) { Debug.LogError("Please Assign a material on the inspector"); return; } GL.PushMatrix(); mat.SetPass(...