473,624 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modern (SDL2) OpenGl 3.3 Not Drawing

93 New Member
Hey I'm new to the modern world of OpenGL but have done quite a lot of older OpenGl stuff.

I had this program displaying stuff via loading in textures and a vertices array, but I changed it so I could append vertices (with their respective color) one by one and "initMesh() " later. For some reason this doesn't work and I can't see why it won't. Would be very appreciated if anyone could help :-). Here's all the files:

main.cpp:
Expand|Select|Wrap|Line Numbers
  1. #include <SDL2\SDL.h>
  2. #include <GL\glew.h>
  3. #include <glm\glm.hpp>
  4. #include "Window.h"
  5. #include "Shader.h"
  6. #include "Mesh.h"
  7.  
  8.  
  9.  
  10. int main(int argc, char *args[])
  11. {
  12.     Window window(600, 600, "Vector Field Editor");
  13.     Shader shader/*("")*/;
  14.  
  15.     Vertex vertices[] = { Vertex(glm::vec3(-0.5, -0.5, 1.0), glm::vec4(1.0f, 0.0f, 0.0f, 1.0f)),
  16.         Vertex(glm::vec3(0,    0.5, 1.0), glm::vec4(1.0f, 0.0f, 0.0f, 1.0f)),
  17.         Vertex(glm::vec3(0.5, -0.5, 1.0), glm::vec4(1.0f, 0.0f, 0.0f, 1.0f)) };
  18.  
  19.     Mesh mesh(GL_TRIANGLES);
  20.  
  21.     mesh.appendVertex(vertices[0]);
  22.     mesh.appendVertex(vertices[1]);
  23.     mesh.appendVertex(vertices[2]);
  24.     mesh.initMesh();
  25.     while (window.isOpen())
  26.     {
  27.         // Clear window
  28.         window.clear(0.0f, 0.0f, 0.0f, 0.0f);
  29.         shader.bind();
  30.         mesh.draw();
  31.         // Update window
  32.         window.update();
  33.         // Handle events
  34.         window.handleEvents();
  35.     }
  36.     return 0;
  37. }
  38.  
Window.h + Window.cpp
Expand|Select|Wrap|Line Numbers
  1. Header:
  2. #pragma once
  3. #include <string>
  4. #include <SDL2\SDL.h>
  5. #include <GL\glew.h>
  6. #include <glm\glm.hpp>
  7. #include <iostream>
  8.  
  9. class Window
  10. {
  11. public:
  12.     Window(int width, int height, const std::string& title);
  13.     virtual ~Window();
  14.  
  15.     void update();
  16.     void handleEvents();
  17.     bool isOpen();
  18.     void clear(float r, float g, float b, float a);
  19.  
  20. protected:
  21.     //
  22. private:
  23.     // The Window
  24.     SDL_Window* window;
  25.     // Windows context
  26.     SDL_GLContext glContext;
  27.     // If the window is closed or not
  28.     bool isWOpen = true;
  29.     // Glew initialization status
  30.     GLenum m_status;
  31. };
  32.  
  33. CPP:
  34. #include "Window.h"
  35.  
  36. Window::Window(int width, int height, const std::string& title)
  37. {
  38.     // Initialize SDL
  39.     SDL_Init(SDL_INIT_EVERYTHING);
  40.     // Sets SDL OpenGL Attributes
  41.     SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
  42.     SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
  43.     SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
  44.     SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
  45.     SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32);
  46.     SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
  47.     SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
  48.     SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
  49.     SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
  50.  
  51.     // Makes the window pointer
  52.     window = SDL_CreateWindow(title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, SDL_WINDOW_OPENGL);
  53.  
  54.     // If window creation failed
  55.     if (window == NULL)
  56.     {
  57.         std::cerr << "SDL Error(couldn't create window): " << SDL_GetError() << std::endl;
  58.     }
  59.  
  60.     // Sets the context for the given window
  61.     glContext = SDL_GL_CreateContext(window);
  62.  
  63.     // If window context creation failed
  64.     if (glContext == NULL)
  65.     {
  66.         std::cerr << "SDL Error(something about glcontext): " << SDL_GetError() << std::endl;
  67.     }
  68.  
  69.     // Using an experimental version of OpenGl
  70.     glewExperimental = GL_TRUE;
  71.     // Initialize Glew
  72.     GLenum status = glewInit();
  73.     // Glew failed to initialize
  74.     if (status = !GLEW_OK)
  75.     {
  76.         std::cerr << "GLEW Error(something about the initilazation): " << glewGetErrorString(status) << " | OpenGL Version: " << glGetString(GL_VERSION) << std::endl;
  77.     }
  78.  
  79.     /*if (GLEW_VERSION_4_5)
  80.     {
  81.         std::cout << "We support version 4.5.0!" << std::endl;
  82.     }*/
  83.  
  84.     glEnable(GL_DEPTH_TEST);
  85.  
  86.     glEnable(GL_CULL_FACE);
  87.     glCullFace(GL_BACK);
  88. }
  89.  
  90. Window::~Window()
  91. {
  92.     // Delete Window Context
  93.     SDL_GL_DeleteContext(glContext);
  94.     // Destroy window
  95.     SDL_DestroyWindow(window);
  96.     // SDL Should quit
  97.     SDL_Quit();
  98. }
  99.  
  100. void Window::update()
  101. {
  102.     // Swap buffers
  103.     SDL_GL_SwapWindow(window);
  104. }
  105.  
  106. void Window::handleEvents()
  107. {
  108.     // Get all events
  109.     SDL_Event e;
  110.     // Extract all events
  111.     while (SDL_PollEvent(&e))
  112.     {
  113.         // If SDL_QUIT event, then window should close
  114.         if (e.type == SDL_QUIT)
  115.             isWOpen = false;
  116.     }
  117. }
  118.  
  119. bool Window::isOpen()
  120. {
  121.     return isWOpen;
  122. }
  123.  
  124. void Window::clear(float r, float g, float b, float a)
  125. {
  126.     glClearColor(r, g, b, a);
  127.     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  128. }
  129.  
  130.  
Shader.h + Shader.cpp
Expand|Select|Wrap|Line Numbers
  1. Header:
  2. #pragma once
  3. #include <string>
  4. #include <GL\glew.h>
  5. #include <iostream>
  6. #include <vector>
  7. #include <fstream>
  8. #include <algorithm>
  9.  
  10. #define VERTEX_SHADER 0
  11. #define FRAGMENT_SHADER 1
  12. #define NUM_SHADERS 2
  13.  
  14. class Shader
  15. {
  16. public:
  17.     Shader();
  18.     virtual ~Shader();
  19.  
  20.     void bind();
  21.     //void update(const Transform& trans, const Camera& camera);
  22. protected:
  23.     //
  24. private:
  25.     //enum { TRANSFORM_U, NUM_UNIFORMS };
  26.  
  27.     GLuint program;
  28.     GLuint shaders[NUM_SHADERS];
  29.     //GLuint uniforms[NUM_UNIFORMS];
  30. };
  31.  
  32. CPP:
  33.  
  34. #include "Shader.h"
  35.  
  36. static std::string LoadShader(const std::string & fileName);
  37. static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, const std::string & errorMessage);
  38. static GLuint CreateShader(const std::string& text, GLenum shaderType);
  39.  
  40. Shader::Shader(/*const std::string& fileName*/)
  41. {
  42.     // Make a program for shaders
  43.     program = glCreateProgram();
  44.     // Make vertex shader
  45.     shaders[VERTEX_SHADER] = CreateShader(LoadShader(/*fileName + ".vs"*/"./shaders/vertexShader.glsl"), GL_VERTEX_SHADER);
  46.     // Make fragment shader
  47.     shaders[FRAGMENT_SHADER] = CreateShader(LoadShader(/*fileName + ".fs"*/"./shaders/fragmentShader.glsl"), GL_FRAGMENT_SHADER);
  48.  
  49.     // Attach all indevidual shaders to the program
  50.     for (unsigned int i = 0; i < NUM_SHADERS; i++)
  51.         glAttachShader(program, shaders[i]);
  52.  
  53.     // Bind the word "position" in the shader as "0"
  54.     glBindAttribLocation(program, 0, "position");
  55.     //
  56.     glBindAttribLocation(program, 1, "color");
  57.  
  58.     // Link shader program
  59.     glLinkProgram(program);
  60.     // Check shader program for linking errors
  61.     CheckShaderError(program, GL_LINK_STATUS, true, "Error: Program linking failed: ");
  62.  
  63.     // Validate shader program
  64.     glValidateProgram(program);
  65.     // Check shader program for validation status
  66.     CheckShaderError(program, GL_VALIDATE_STATUS, true, "Error: Program is invalid: ");
  67.  
  68.     /*uniforms[TRANSFORM_U] = glGetUniformLocation(program, "transform");*/
  69. }
  70.  
  71. Shader::~Shader()
  72. {
  73.     // Deleting all shaders
  74.     for (unsigned int i = 0; i < NUM_SHADERS; i++)
  75.     {
  76.         glDetachShader(program, shaders[i]);
  77.         glDeleteShader(shaders[i]);
  78.     }
  79.     // Delete shader program
  80.     glDeleteProgram(program);
  81. }
  82.  
  83. void Shader::bind()
  84. {
  85.     // Binds the program to window
  86.     glUseProgram(program);
  87. }
  88.  
  89. /*void Shader::update(const Transform& transform, const Camera& camera)
  90. {
  91.     glm::mat4 model = camera.getViewProjection() * transform.getModel();
  92.  
  93.     glUniformMatrix4fv(uniforms[TRANSFORM_U], 1, GL_FALSE, &model[0][0]);
  94. }*/
  95.  
  96. std::string LoadShader(const std::string& fileName)
  97. {
  98.     std::ifstream file((fileName).c_str());
  99.  
  100.     std::string output;
  101.     std::string line;
  102.  
  103.     if (file.is_open())
  104.     {
  105.         while (file.good())
  106.         {
  107.             getline(file, line);
  108.             output.append(line + "\n");
  109.         }
  110.     }
  111.     else
  112.     {
  113.         std::cerr << "Unable to load shader: " << fileName << std::endl;
  114.     }
  115.  
  116.     return output;
  117. }
  118.  
  119. void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, const std::string& errorMessage)
  120. {
  121.     GLint success = 0;
  122.     GLchar error[1024] = { 0 };
  123.  
  124.     if (isProgram)
  125.         glGetProgramiv(shader, flag, &success);
  126.     else
  127.         glGetShaderiv(shader, flag, &success);
  128.  
  129.     if (success == GL_FALSE)
  130.     {
  131.         if (isProgram)
  132.             glGetProgramInfoLog(shader, sizeof(error), NULL, error);
  133.         else
  134.             glGetShaderInfoLog(shader, sizeof(error), NULL, error);
  135.  
  136.         std::cerr << errorMessage << ": '" << error << "'" << std::endl;
  137.     }
  138. }
  139.  
  140. GLuint CreateShader(const std::string& text, GLenum shaderType)
  141. {
  142.     GLuint shader = glCreateShader(shaderType);
  143.  
  144.     if (shader == 0)
  145.         std::cerr << "Error: Shader creation failed!" << std::endl;
  146.  
  147.     const GLchar* shaderSourceStrings[1];
  148.     shaderSourceStrings[0] = text.c_str();
  149.     GLint shaderSourceStringLengths[1];
  150.     shaderSourceStringLengths[0] = text.length();
  151.  
  152.     glShaderSource(shader, 1, shaderSourceStrings, shaderSourceStringLengths);
  153.     glCompileShader(shader);
  154.  
  155.     CheckShaderError(shader, GL_COMPILE_STATUS, false, "Error: Shader compilation failed: ");
  156.  
  157.     return shader;
  158. }
  159.  
  160.  
Vertex.h (inline):
Expand|Select|Wrap|Line Numbers
  1. #pragma once
  2. class Vertex
  3. {
  4. public:
  5.     Vertex(const glm::vec3& pos, glm::vec4& color = glm::vec4(1.0f, 1.0f, 1.0f, 1.0f))
  6.     {
  7.         this->pos = pos;
  8.         this->color = color;
  9.     }
  10.  
  11.     virtual ~Vertex() {}
  12.  
  13.     inline glm::vec3 getPos() { return pos; }
  14.     inline void setPos(glm::vec3 pos) { this->pos = pos; }
  15.     inline glm::vec4 getColor() { return color; }
  16.     inline void setColor(glm::vec4 pos) { this->color = color; }
  17.  
  18.     bool operator==(Vertex& other) const
  19.     {
  20.         return (pos == other.getPos() && color == other.getColor());
  21.     }
  22.  
  23. protected:
  24.     //
  25. private:
  26.     glm::vec3 pos;
  27.     glm::vec4 color;
  28. };
  29.  
Mesh.h + Mesh.cpp
Expand|Select|Wrap|Line Numbers
  1. Header:
  2. #pragma once
  3. #include <glm/glm.hpp>
  4. #include <gl/glew.h>
  5. #include <vector>
  6. #include <string>
  7. #include <cassert>
  8. #include <iostream>
  9. #include "Vertex.h"
  10. #include "stb_image.h"
  11.  
  12. class Mesh
  13. {
  14. public:
  15.     Mesh(GLenum drawType/*, unsigned int* indecies, unsigned int numIndecies*/);
  16.     virtual ~Mesh();
  17.  
  18.     void appendVertex(Vertex vertex);
  19.     void draw();
  20.     void initMesh();
  21. protected:
  22.     //
  23. private:
  24.     enum {POSITION_VB, COLOR_VB, /*INDEX_VB,*/ NUM_BUFFERS};
  25.  
  26.     std::vector<Vertex> vertices;
  27.  
  28.     GLuint vertexArrayObject;
  29.     GLuint vertexArrayBuffers[NUM_BUFFERS];
  30.     //unsigned int nrVertices;
  31.     //bool textureAvaliable;
  32.     GLenum drawType;
  33. };
  34.  
  35. CPP:
  36.  
  37. #include "Mesh.h"
  38.  
  39. Mesh::Mesh(GLenum drawType/*, unsigned int* indecies, unsigned int numIndecies*/)
  40. {
  41.     // Set the drawType
  42.     this->drawType = drawType;
  43. }
  44.  
  45. Mesh::~Mesh()
  46. {
  47.     // Delete vertex array
  48.     glDeleteVertexArrays(1, &vertexArrayObject);
  49.     glDeleteBuffers(NUM_BUFFERS, vertexArrayBuffers);
  50. }
  51.  
  52. void Mesh::appendVertex(Vertex vertex)
  53. {
  54.     vertices.push_back(vertex);
  55.     //nrVertices++;
  56. }
  57.  
  58. void Mesh::draw()
  59. {
  60.     // Bind the vertex array object
  61.     glBindVertexArray(vertexArrayObject);
  62.     // Draw array
  63.     glDrawArrays(/*drawType*/ GL_TRIANGLES, 0, /*nrVertices*/vertices.size());
  64.     // Clear binding of vertex array
  65.     glBindVertexArray(0);
  66. }
  67.  
  68. void Mesh::initMesh()
  69. {
  70.     // Generate vertex array object
  71.     glGenVertexArrays(1, &vertexArrayObject);
  72.  
  73.     // Bind the vertex array object
  74.     glBindVertexArray(vertexArrayObject);
  75.  
  76.     std::vector<glm::vec3> positions;
  77.     std::vector<glm::vec4> colors;
  78.  
  79.  
  80.     // Prereserve enough memory
  81.     positions.reserve(/*nrVertices*/vertices.size());
  82.     colors.reserve(/*nrVertices*/vertices.size());
  83.  
  84.     // Move all positions and texCoords over
  85.     for (unsigned int i = 0; i < /*nrVertices*/vertices.size(); i++)
  86.     {
  87.         positions.push_back(vertices[i].getPos());
  88.         colors.push_back(vertices[i].getColor());
  89.     }
  90.  
  91.     for (unsigned int i = 0; i < /*nrVertices*/vertices.size(); i++)
  92.     {
  93.         std::cout << "\n\nPosition: (" << positions[i].x <<
  94.                                   ", " << positions[i].y <<
  95.                                   ", " << positions[i].z << ")\n Color: (" << colors[i].x <<
  96.                                                                       ", " << colors[i].y <<
  97.                                                                       ", " << colors[i].z <<
  98.                                                                       ", " << colors[i].w << ")";
  99.     }
  100.  
  101.     // Generate buffer
  102.     glGenBuffers(NUM_BUFFERS, vertexArrayBuffers);
  103.  
  104.     // !!!! Make a buffer for VERTEX POSITIONS !!!!
  105.     // Bind the buffer
  106.     glBindBuffer(GL_ARRAY_BUFFER, vertexArrayBuffers[POSITION_VB]);
  107.  
  108.     // Put the given data in buffer
  109.     glBufferData(GL_ARRAY_BUFFER, /*nrVertices*/vertices.size() * sizeof(positions[0]), &positions[0], GL_STATIC_DRAW);
  110.  
  111.     // Enable vertex attribute array POSITION_VB
  112.     glEnableVertexAttribArray(POSITION_VB);
  113.  
  114.     // Gett OpenGl how to use the vertex attribute array
  115.     glVertexAttribPointer(POSITION_VB, 3, GL_FLOAT, GL_FALSE, 0, 0);
  116.  
  117.     // !!!! Make a buffer for the COLORS !!!!
  118.     // Bind the buffer
  119.     glBindBuffer(GL_ARRAY_BUFFER, vertexArrayBuffers[COLOR_VB]);
  120.  
  121.     // Put the given data in buffer
  122.     glBufferData(GL_ARRAY_BUFFER, /*nrVertices*/vertices.size() * sizeof(colors[0]), &colors[0], GL_STATIC_DRAW);
  123.  
  124.     // // Enable vertex attribute array COLOR_VB
  125.     glEnableVertexAttribArray(COLOR_VB);
  126.  
  127.     // Gett OpenGl how to use the vertex attribute array
  128.     glVertexAttribPointer(COLOR_VB, 4, GL_FLOAT, GL_FALSE, 0, 0);
  129.  
  130.     // Bind vertex array
  131.     glBindVertexArray(0);
  132. }
  133.  
Vertex.glsl + Fragment.glsl
Expand|Select|Wrap|Line Numbers
  1. Vertex:
  2. #version 330
  3.  
  4. attribute vec3 position;
  5. attribute vec4 color;
  6.  
  7. varying vec4 color0;
  8.  
  9. //uniform mat4 transform;
  10.  
  11. void main()
  12. {
  13.     //gl_Position = /*transform * */vec4(position, 1.0);
  14.     gl_Position = vec4(position, 1.0);
  15.     color0 = color;
  16. }
  17.  
  18. Fragment:
  19. #version 330
  20.  
  21. varying vec4 color0;
  22.  
  23. void main()
  24. {
  25.     gl_FragColor = color0;
  26. }
  27.  
Jun 26 '17 #1
4 2115
weaknessforcats
9,208 Recognized Expert Moderator Expert
I am not an OpenGL person but I did have a question. In main() a mesh object s created, a constructor called, various other mesh member functions are called, and then initMesh member function is called.

Shouldn't initMesh be part of the constructor? It just looks odd that a mesh object is created, modified, and then initialized.
Jun 26 '17 #2
Xillez
93 New Member
No, the reason is that I can add a unknown number of vertices in a mesh and once the mesh initializes, OpenGL takes all those vertices at once and dumps them in a buffer for drawing. That's why it's Create, Modify and then Init :-) (I do understand that it looks a little weird) Plus it cuts down on the amount of array's of vertices I would need to have everywhere and it makes the code a little more cleaner I think :-)
Jun 26 '17 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
The next step is to put a breakpoint at the beginning of each function and start the code using your debugger. Each time a function is called, execution breaks to the debugger. You can see where the call came from and verify all the variables in the code are in the correct state.

When you are sure a function is correct, remove its breakpoint.

Obviously, the debugger should run to breakpoint rather than stepping a line at a time.

When there are no breakpoints left, the code should be working.

Let me know what happened.
Jun 26 '17 #4
Xillez
93 New Member
I kind of fixed it. It was the "Depth_Buff er", "Depth_Test " and "GL_Cull_Fa ce" that messed it up. OpenGL is testing each pixels z-value in the depth buffer, but I haven't assigned a depth buffer to be used other than saying OpenGl will get 16+ bits to store depth information per pixel, so OpenGl doesn't draw. Plus that I reverted "Mesh.h + Mesh.cpp" to take everything it needs and initializes immediately, instead of waiting for vertices and then initializing. But at least I can draw now :-)
Jun 26 '17 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
3187
by: Rick Muller | last post by:
I have a problem that I would like to get some advice on from other Pythonistas. I currently manage a (soon to be) open source project for displaying molecular graphics for a variety of different programs. To do this I need to draw pictures of the molecules, typically using OpenGL, and do some basic control, using some widget set. The code currently uses GTK, and runs on Macintosh OS X under Fink, and Linux. I would like to support the...
2
7306
by: Rameshika | last post by:
Hi All I am new to 3D modelling in VISUAL .NET C#.I am planning to draw the entire roof (showing the roof material, roof angle, roof shape,ceiling shape, ceiling material) of the house and planning to use OpenGL. Please let me know whether I can use opengl with C# and also how to add referance to C# becasue I'm not sure witch namespace to use and is there any c# sample coding to be found developed with opengl? if any please let me know...
0
3640
by: Scott Chang | last post by:
Hi all, I tried to use Managed C++ coding of VC++.NET (2002)and OpenGL version 1.2 to draw a hexagon shape of benzene. My OpenGLdrawBenzene.cpp is the following: // This is the main project file for VC++ application project // generated using an Application Wizard. #include "stdafx.h" #include <stdlib.h>
1
5609
by: Scott Chang | last post by:
Hi All I tried to use the attached OpenGL code to draw a Star-shaped figure on my Microsoft Visual C++ .NET 2002-Windows XP Pro PC. When I did 'Build' in Debug Mode, I got an error C2065: 'RenderScence': undeclared identifier. Please help and tell me (1) what it is wrong with my coding in this program and how to correct the problem, and (2) whether the functions/commands of the OpenGL v1.1 (existing in Microsoft Visual C++ .NET 2002) and GLUT...
8
1722
by: NaeRey | last post by:
Hey, I've been searching for something like a PyOpenGL implementation that allows Python to use OpenGL, found only a few projects and most are either in beta and dead, or alpha stage. Anyone knows a package thats currently being worked on and is functional? Thanks
14
2645
by: Jessica Weiner | last post by:
I am writing an application in C# which need to plot graphs and simple shapes (polygons, circles, squares etc). Which library is better for this purpose and why? Thanks.
6
3626
by: Mark Thompson | last post by:
I have a problem with my Visual Basic .NET 2003 application which I have so far been unable to resolve. I am trying to get an OpenGL control that I have created working properly as a control on my main form in my VB.NET application. It does work and render correctly but the problem is that there is an awful flickering that happens on most PCs I try it on. The flickering is reminiscent of the sort that you get on a TV when it is not tuned...
3
9984
by: jg.campbell.ng | last post by:
I'm beginning learning Python and OpenGL in Python. Python fine. But difficulties with OpenGL; presumably with the installation of OpenGL. OS = Linux FC5. Python program gl_test.py: from OpenGL.GLUT import *
0
1960
by: Code Bug | last post by:
Basically, I want to connect the tip of each plane to the other. So I thought I might try creating a variable specifically for the points I want to connect: The tip of each plane. Then, for each plane in the planes list, I would get the point of that specified tuple of each plane, add it to a list of points, and draw a line to each. But it's not working. When I try to pass planes.tip: glVertex3f(planes.tip), I get the following error; ...
1
2019
by: game2d | last post by:
I am trying to create a triangle in openGL 2.0 but some some reason background is shows up but no triangle. I am following this tutorial: http://developer.android.com/training/graphics/opengl/environment.html i have the same code as on tutorial but for some reason the triangle is not showing up. may be i missed some thing or i am doing some thing wrong? i have two class. GlRender.java GLTriangle.java i think the problem is in...
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8677
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8620
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.