155 Topics
| |
I'm trying to use CLion (thus CMake) to create OpenGL applications using C++ on MacOS Monterey using a 2021 (so M1 based) Macbook. Glew2 and GLFW3 are installed correctly using Homebrew, XCode and the commandline tools are installed as well. Creating and compiling/running through XCode works fine, but using the … | |
I worked about 2 weeks with OpenTK and I like to know how to texture triangles. I like to give my program, the flexibility to make shapes like triangles, cubes, spheres and to give them different textures (or shaders). I like to give my window a icon, but it says … | |
I'm coding a program to learn OpenGL in C++ (based off of The Benny Boxes tutorials) and I've run into a snag where I don't get any errors, but my shaders refuse to apply to the triangle that I'm rendering. I'm going to give you all the relevant code but … | |
I've been working with my own system using CPU-managed hitdefs (rectangles for mouse-events) since I didn't want to redraw everything for the gl feedback buffer... (basically I can do all the hitdef position management once during the frame loop) now that modern gl has come into play, I would like … | |
Since OpenGL uses the strange system of 1s and 0s to represent location on the screen, I'm trying to figure out how to switch it to standard x, y coordinates like those that are used on a graph. And so far, my searches on the rest of the internet have … | |
Hey. I've been working on a home brew game since late last year, writing an engine in Haskell and GLSL that includes 3D graphics, basic physics and programmable game logic. The version in the second video shows the first appearance of lighting and importation of OBJ files (the cube was … | |
So I'm maing a 3D game editor in Java using LWJGL (Lightweight Java Game Library), I have the editor set up so that the user can create new levels, load up saved levels, save and quick save current levels, import textured models etc.. the basics. I am now trying to … | |
I am trying to run the code in openGL in Visual Studio 2013 after installation. It shows error as "Cannot open source file <GL/glew.h> and <GL/glut.h> ". Also it shows "Identifier glutInit is undefined". Can you please resolve this issue ?? #include <GL/glew.h> #include <GL/glut.h> #pragma comment(lib, "glew32.lib") int main(int … | |
on my university I got an assignment to build a program on OpenGl that read from a given txt file a coordinates of some lines and draw them to the screen. i thank everyone that might help me, I know a little bit programming on C but I'm a little … | |
void PatratTexturat(PATRAT patrat, int numar) { switch(numar) { case 1: if(numar==1) glBindTexture(GL_TEXTURE_2D, id_textura[2]); else glBindTexture(GL_TEXTURE_2D,id_textura[3]); break; case 2: if(numar==2) glBindTexture(GL_TEXTURE_2D, id_textura[4]); else glBindTexture(GL_TEXTURE_2D, id_textura[5]); break; case 3: if(numar==3) glBindTexture(GL_TEXTURE_2D, id_textura[6]); else glBindTexture(GL_TEXTURE_2D, id_textura[7]); case 4: if(numar==4) { glBindTexture(GL_TEXTURE_2D, id_textura[8]); } else { glBindTexture(GL_TEXTURE_2D, id_textura[9]); } break; case 5: glBindTexture(GL_TEXTURE_2D,id_textura[10]); break; … | |
void PatratTexturat(PATRAT patrat, int numar) { switch(numar) { case 1: if(numar==1) glBindTexture(GL_TEXTURE_2D, id_textura[2]); else glBindTexture(GL_TEXTURE_2D,id_textura[3]); break; case 2: if(numar==2) glBindTexture(GL_TEXTURE_2D, id_textura[4]); else glBindTexture(GL_TEXTURE_2D, id_textura[5]); break; case 3: if(numar==3) glBindTexture(GL_TEXTURE_2D, id_textura[6]); else glBindTexture(GL_TEXTURE_2D, id_textura[7]); case 4: if(numar==4) { glBindTexture(GL_TEXTURE_2D, id_textura[8]); } else { glBindTexture(GL_TEXTURE_2D, id_textura[9]); } break; case 5: glBindTexture(GL_TEXTURE_2D,id_textura[10]); break; … | |
Hi there, i have a ball: [icode] void ball (void) { glColor3f(0.0, 1.0, 0.0); //set ball colour glTranslatef(0.0,0.0,1); //moving it toward the screen a bit on creation glutSolidSphere (0.6, 7, 7); //create ball. } [/icode] I am trying to get the ball to move in a direction when i press … | |
Hello everyone, I am trying to write an object loader in c++. Currently, I have a file that is made up of many sub objects and I am having a little difficulty figuring out how to process the data. First of all, here is an example of part of the … | |
Hi, I have a C++ code running OpenGL GUI (CEGUI), I need to wrap this window inside a C# Application. I guess I will compile the C++ as a dll, and add entry points for the C# app. What is the preffered way to do this? I thought of these … | |
**BREAKOUT GAME IN OPENGL** code is in C. Use the 's' and 'd' to move the paddle. Bounce the ball off the paddle to keep it from falling off the bottom of the screen. Break all the bricks to win. So far the program is running. but the right brick … | |
Does my old Intel 946GZ Express Chipset Family supports OpenGL 2.0...? Plz reply soon i want to sale it to a minecraft lover...! | |
Hello, So I was testing my matrix class and the results look questionable and the inverted matrix isn't returning the vertex to it's original value (a seperate issue). Given a perspective projection at 45 degrees with a near of 1 and a far of 1000, the camera at the orgin … | |
Hello, So I'm aware that OpenGL is Column major and DirectX is Row major, but how does that translate into a basic 1D array? So given the below visual matrix, what would the first 3 in the array of each platform and which 3 would be the x,y and z … | |
My university's TA helped me setup all the necessary files to run OpenGL on vs 2008 (even though his .cpp and .h files were written in vs2013) yet when I compile the project, it gives me a white window. The same code will display a 3d mouse in the computer … | |
hi everybody! I really need your help here. I am developing a 3D game. so far I have came no further than finishing the 3D engine and print out some basic 3D-models. everything works okay, with exception of a bug, occuring after a couple of minutes of running time. it … | |
I need the way in SDL work with openGL for allow users input String by writing text . | |
how to get mouse coordinates when user click by mouse using opengl ? | |
I have used sdl_ttf in opengl . but i have this error : error LNK1104: cannot open file 'SDL_ttf.lib' i already have tried to remove the "SDL_ttf.lib" , but it didn't useful. i have trid used : lazyfoo.net for setting up the opengl with sdl pls tell me what must … | |
I need the way for allow users input text by writing , while users input text they see what's they input when user press enter jump for next line and when user end press on button to finish ? | |
| I've tried lots of times to get this to work but , no luck . the problem is this program shows white screen , and It doesn't display the polygon . Here's the code , take a look : /*Headers*/ #include <GL/glut.h> /*End of headers*/ /* Check Compiler*/ #ifdef __FLAT__ … |
I'm trying to create a simple colored cube using vbo(well it actually a rectangle with z = 0). I am using glew & freeglut. Here my code. #include <GL/glew.h> #include <GL/glut.h> #include <stdio.h> const int g_width = 800; const int g_height = 800; #pragma comment(lib, "glew32.lib") static const GLsizeiptr PositionSize … | |
Hello, I can get OpenGL to render 3D scenes to the screen, but I want to render them to a pixel array. Basically I want some magical code to fill in the blanks for this code segment: int width=500; int height=500; uint32_t *colours=new uint32_t[width*height]; //Magic code! glBegin(GL_TRIANGLES); //other drawing stuff, … | |
Hello, Unfortunately I learnt OpenGL from NeHe tutorials, which means that all of my current methods for OpenGL-ing are extremely deprecated. I tried to find a more up-to-date tutorial, but all they seem to do is teach how to get really complicated stuff out of OpenGL. I just want to … | |
Can someone please help me understand what the glMatrixMode() function does? I've read the API and looked on google but I cannot understand what it does. An anology or example would help. Thanks. | |
Hello, I am wondering how libraries create graphics contexts in a cross-platform manner. Somehow libraries like SDL create graphical windows seemingly without using the system headers. I know how to set up a window for graphics using Win32API, and how to get input from it using the same. How do … |
The End.