Search found 23 matches

by corey__cakes
Tue Jan 24, 2017 12:31 am
Forum: Programming Discussion
Topic: Programming Professor shinanigains
Replies: 4
Views: 15321

Programming Professor shinanigains

Hello, I couldn't think of a better topic to post this question in other than programming discussion because it has to do with programming. To be more specific, learning programming from a tenured college professor who may or may not know how to teach or what they're doing. I am a sophomore undergra...
by corey__cakes
Sat Dec 03, 2016 11:19 am
Forum: Programming Discussion
Topic: Optimal use of frame buffers in a 2D game.
Replies: 7
Views: 8089

Re: Optimal use of frame buffers in a 2D game.

Thank you. :)

I guess I thought blending was a part of the fixed-function pipeline, and when I use shaders, any blending I wanted to occur is calculated in the shader. I guess I should study farther in some books. Thank you though.
by corey__cakes
Fri Dec 02, 2016 4:16 pm
Forum: Programming Discussion
Topic: Optimal use of frame buffers in a 2D game.
Replies: 7
Views: 8089

Re: Optimal use of frame buffers in a 2D game.

This seems to me like a solution you came up with yourself. My question is: what is the problem? If you can elaborate on what problem you're running into more specifically than "my code is a mess", perhaps we can offer you some ideas. I'm having this problem with shaders and frame buffers...
by corey__cakes
Fri Dec 02, 2016 9:42 am
Forum: Programming Discussion
Topic: Optimal use of frame buffers in a 2D game.
Replies: 7
Views: 8089

Re: Optimal use of frame buffers in a 2D game.

Are you sure that what you are talking about here is not "vertex buffers" rather than "frame buffers"? No, I'm actually talking about user-defined frame buffers, frame buffer objects. Maybe this is a dumb question and I'm overthinking the problem. I understand the whole front bu...
by corey__cakes
Wed Nov 30, 2016 10:08 pm
Forum: Programming Discussion
Topic: Optimal use of frame buffers in a 2D game.
Replies: 7
Views: 8089

Optimal use of frame buffers in a 2D game.

Greetings, I have a question regarding how I should use frame buffers in OpenGL 3.3 for a 2D game I'm slowly making. I tried to write down all the frame buffers I think I'd need. Each framebuffer would be the dimension of the screen, so 640x480 for instance. I came up with something like this: Use a...
by corey__cakes
Sun Jan 31, 2016 12:59 pm
Forum: Programming Discussion
Topic: Animating a texture in OpenGL
Replies: 3
Views: 7229

Re: Animating a texture in OpenGL

You can give your shader some uniforms that define which part of the texture to use and use them to calculate the value of gl_TexCoord[0] in your shader. Manipulating the texture matrix is also possible but I find the uniform approach more straight-forward. I'm not using shaders though. I'm learnin...
by corey__cakes
Sat Jan 16, 2016 11:34 am
Forum: Programming Discussion
Topic: Animating a texture in OpenGL
Replies: 3
Views: 7229

Animating a texture in OpenGL

Hello, I have a question. What is the best way to animate a sprite from a sprite sheet loaded in as an OpenGL texture? The only ways I could think of were to change the values used in glTexCoord*() or to switch the matrix mode to GL_TEXTURE and then use glTranslate*(). What other ways are there? Rig...
by corey__cakes
Tue Sep 22, 2015 12:32 pm
Forum: Programming Discussion
Topic: Identifier not found when it is.... what?
Replies: 5
Views: 6829

Re: Identifier not found when it is.... what?

Sorry, I had to type this post twice because my internet was being stupid. So the second time was a little rushed. I keep getting the error "identifier not found." Can you please post the exact, full error in [ code ] tags. I have no idea which identifier you're talking about. Are you sur...
by corey__cakes
Mon Sep 21, 2015 4:04 pm
Forum: Programming Discussion
Topic: Identifier not found when it is.... what?
Replies: 5
Views: 6829

Re: Identifier not found when it is.... what?

Well it's not working. Well I can't help you [without more information about your actual problem]. Could you perhaps describe what exactly "not working" means? Sorry, I had to type this post twice because my internet was being stupid. So the second time was a little rushed. I keep getting...
by corey__cakes
Mon Sep 21, 2015 3:22 pm
Forum: Programming Discussion
Topic: Identifier not found when it is.... what?
Replies: 5
Views: 6829

Identifier not found when it is.... what?

I am making a level editor with C++ and SDL. In this program, I have function called CreateTexture() that returns a texture with the dimensions specified in what I pass through the parameters. This function is declared in a header SysFunc.h and defined in SysFunc.cpp (sorry if I use the wrong termin...
by corey__cakes
Fri Jul 31, 2015 9:49 am
Forum: Programming Discussion
Topic: Passing a Pointer as a Reference, Deallocating SDL2 objects
Replies: 7
Views: 9087

Re: Passing a Pointer as a Reference, Deallocating SDL2 obje

When the function goes out of scope, the copy of the pointer is destroyed (again, it's just an integer on the stack; whereas the thing it points to (in this case the "SDL_Renderer") is dynamically allocated memory on the heap which needs to be freed at some point). So you don't need to &q...
by corey__cakes
Mon Jul 27, 2015 11:28 pm
Forum: Programming Discussion
Topic: Passing a Pointer as a Reference, Deallocating SDL2 objects
Replies: 7
Views: 9087

Passing a Pointer as a Reference, Deallocating SDL2 objects

So I have a big question. I'm using C++ with SDL2 and I want to know if I can pretty much do this without any damage: #include<SDL.h> //Creates an SDL Texture in a very unefficient manner SDL_Texture* CreateTexture(SDL_Renderer*& render, int width, int height) { //Create and fill a surface SDL_S...
by corey__cakes
Sat Mar 21, 2015 8:45 am
Forum: Programming Discussion
Topic: My lack of Problem Solving abilities
Replies: 2
Views: 3744

My lack of Problem Solving abilities

Hello! I have gotten to the point of my programming knowledge to know that I have surpassed the noobs. I may have even consider myself surpassing the intermediates but there's really something holding me back from that. Say for example, I wanted to make a shmup. I wouldn't know how to go about doing...
by corey__cakes
Wed Mar 04, 2015 9:55 am
Forum: Programming Discussion
Topic: OpenGL Textures with SDL
Replies: 8
Views: 3265

Re: OpenGL Textures with SDL

I tried using every possible flag, which probably isn't good, and GL_BGR WORKS. The question is why does it work? Do I need to read the red book of OpenGL in order to fully understand why?
by corey__cakes
Tue Mar 03, 2015 10:06 am
Forum: Programming Discussion
Topic: OpenGL Textures with SDL
Replies: 8
Views: 3265

OpenGL Textures with SDL

I've been learning how to program OpenGL with SDL in C++ and I've reached a point where my mind has been obliterated. I am no computer scientist so OpenGL is god-like powers for game development. What I'm trying to wrap my head around is the bits and bytes and depth size and buffer size. At least th...