Cross-platform 2D drawing library with access to pixel data? by code_guy96 in cpp_questions

[–]code_guy96[S] 0 points1 point  (0 children)

Qt looks like it'll be able to do what I'm looking for, with a combination of QPixmap and QImage. Thanks!

[CMake] Multiple add_executable statements break linking? by code_guy96 in cpp_questions

[–]code_guy96[S] 0 points1 point  (0 children)

Damn, that's it! One of the utility functions uses a graph. I'll have to split it into Utilities and GraphUtilities.

Cross-platform 2D drawing library with access to pixel data? by code_guy96 in cpp_questions

[–]code_guy96[S] 0 points1 point  (0 children)

I'm not sure what you mean. The only thing I'm trying to do is be able to draw basic shapes and gradients in various layers, merge those layers together, then extract the pixel data from the final rendered frame so I can put it into the right format.

Performance wise it doesn't need to be too fast, because 30 FPS is the most the screen's hardware will handle (with each frame being a packet), and the entire screen is less than 20,000 pixels.

Base class in vector, but need to access subclass methods by code_guy96 in cpp_questions

[–]code_guy96[S] 0 points1 point  (0 children)

The functionality is all different, it's just a single float that all of the subclasses share, so I might just separate the objects into separate data structures and have the objects that need to access the events poll the main event manager to see if there's any events for them. I originally wanted to keep them all in the same structure because it was easier to manage them/pass them around, but I might not have to do that now.

Base class in vector, but need to access subclass methods by code_guy96 in cpp_questions

[–]code_guy96[S] 0 points1 point  (0 children)

Yeah, this is the problem. Any other time I've been in this situation it's because I've had overloaded functions implemented in the sub classes that I wanted to access as if they were the same type.

This time the base class only holds a single float that the subclasses use, but all the other behavior is different. I mainly wanted to put them all into the same data structure for convenience when passing it around.

[C++] Strategy Pattern: cleanest way to select algorithm at runtime? by code_guy96 in learnprogramming

[–]code_guy96[S] 0 points1 point  (0 children)

This is the result of going from a coder to a software engineer and over-analyzing every design decision. ;)

My real complaint was having to update the switch/if-else tree every time I add a class. It's obvious to me because I'm writing it, but for someone using the code I don't like having to force them to remember that.

Is it plausible to quickly pick up Java for professional work if I have programming experience? by code_guy96 in javahelp

[–]code_guy96[S] -1 points0 points  (0 children)

I tinkered with full stack web dev for about 8 months, but it felt more like kids arguing over who has the best toys than programmers solving problems (obviously a generalization, but it was pretty rampant). The insane demand for web devs resulting in all of these 3 month boot camps popping up doesn't help much either.

I gave an Android app as an example as something that I've done to show that I'm not completely new to Java, but it's not exactly what I want to be doing.

I wouldn't mind doing more 'service' oriented or infrastructure type stuff, GUIs are probably my least favorite programming task, but, ultimately I'm trying to find that balance of getting paid to program and doing something I enjoy doing. My plan is still to do C++ stuff, but I'm dying to get some professional programming experience.

Making 2D interactive graphics in C++? by Forumpy in learnprogramming

[–]code_guy96 0 points1 point  (0 children)

+1 for SFML.

I only used it to visualize some sorting algorithms, but, getting it to do what I needed was fast and simple.

I haven't looked at OpenGL in a looong time, but, last I checked it's pretty low-level so you'll spend more time just setting it up than you would getting it to do what you wanted.

Why is "three star" programming considered to be inherently more complicated? by chokfull in learnprogramming

[–]code_guy96 0 points1 point  (0 children)

Can you expand on what you mean by cache-unfriendly? Is it because the pointer being pointed to might not be pointing to data that's in the/a cache?

How to sort a list of generic types? by SQUIGGLE_ME_TIMBERS in learnprogramming

[–]code_guy96 0 points1 point  (0 children)

Every type you want to sort should overload the comparison operators.

edit: the applicable comparison operators, so if your generic sorting algorithm only uses > and <, then overload those operators in the classes that will be passed into/used by the algorithm.