Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "sdl2"
-
Well, guess I'm eating my shoe it seems .-.
(Trying to get font rendering working in SDL2 and for whatever reason, loading a direct TTF file works but as soon as I load it into RWops and pass to SDL, it suits the bed)9 -
Been 122 days since my last post, since then I have been working on a game engine on Vala using SDL2 in my free time (Lol I have none)
Decided to put that on ice or just work on it when drunk (very common occurrence) and teaching myself C while working on a game or game engine, hopefully will have some quality rants inbound!3 -
So, I'm still not certain if it's actually a bug or merely my lack of experience, but I've been working on a 2D platformer game (using only C++ and SDL2) for roughly 2 years now (on and off; sometimes off for months) and I'm extremely embarrassed about this, but for the life of me, I cannot seem to get the player character's movement and collision physics working properly. It's driving me absolutely insane.
I've read articles and tutorials, referenced books, and posted about it in game development communities (e.g., gamedev.com, Discord servers, etc.), but even though the fundamental structure and explanations made sense, getting the code to work has been unsuccessful, albeit not completely so, but if I get one thing working, another thing breaks. It feels like I'm trying to repair a vase that fell off of a skyscraper and turned to dust on the street below.
I've always been a very tech savvy person with a fiery passion for programming, electronics and game/software/embedded/web development, but to be honest, having such a difficult time with things like this that — in theory, at least — seem like trivial bumps in the road have made me feel like I'm never going to be successful in this field. But regardless of the depressing thoughts of worthlessness, my passion doesn't let me stop trying. Who knows, maybe it'll have to remain just a hobby. 😕4 -
So I have never done 'real' development on anything bar my current game engine Virgil, however found myself referring to C documentation for GLib and SDL2 rather than valadoc documentation.
Decided fuck it, I'm already converting everything to Vala's pointer syntax so I can have manual memory control, implementing stb_image and contemplating reworking SDL2_image into raw C so I'm not depending on extra libraries... Why do all this when I can just learn C and have more control.
Everything was going well and decided to buy the C programming language book, already knew about pointers and structs but ohhhhhhhhhhhhhhhhhhhh boi was I not ready for malloc .-.7 -
Couldn't be arsed with all the conditional compilation that angelscript required, so I dumped right back to good ol' lua for now.
Got lua in, vm started, loading strings and pushing/popping the stack.
Got SDL actually drawing as intended.
I don't know even half of what I'm doing.
Apparently header files that end in ".hpp" are specific to c++, while .h are for c headers.
I like the new SDL2 though, little bit different than SDL1. Not a lot of tutorials cover the difference, but I could kinda suss out from the documentation where I needed to adapt, even though I'm still pretty loose on the library, on the docs, and on c++ itself.
Still just a learning project.
Also, I'm continually surprised there isn't a portable, platform independent tool or little language just for replacing all pseudo-languages out there like .bat and .sh, and .zsh
Maybe even just a tool that standardizes it all, then takes config files that map the new standard to system dependant commands, so you can download the damn thing, configure the relevant environment variables, drop in the platform dependent configuration (or your browser or package tool detects what platform you are on and chooses the relevant package/download for your platform), write a console script and the tool automatically translates, and emits the system-relevant commands to that platform's console (so you don't even need much platform-specific code to do things like file access). -
So started building a game engine in Vala using SDL2, I have never built anything from scratch and decided to do it with no tutorials and just looking at the documentation on valadoc... So of course all of the pages for SDL2 and it's sub components show up fucking blank... Well isn't this dandy .-.
-
If there's one problem with rust, it's that it expects you to know how to use it.
One of my first projects was to try and use the SDL2 crate to make something, and I got stuck wrangling the borrow checker about how long my textures live.
I try again a year later, now knowing intuitively how the lifetime system works, and I come up with a solution easily.
This sort of thing is probably very discouraging to new users of the language4 -
Okay I've commented on multiple people's post already but I've decided to write a rant on it.
GOD I hate C++. For our software architecture minor we have to develop a game with only C++ and SDL and it's been one big freaking nightmare.Where almost every freaking language I've worked with has a proper way to add third party libraries most of them in C++ don't even fucking work after spending half a day. I know a lot of you guys love programming in C++, but it's been the language I've been struggling the most with in four years of university. Unbelievable. Fuck it's freaking pointers and all it's bullshit.3 -
so recently i have been through memory management hell. maybe i should rethink about pointers and stuff.
long story short: i have done a calendar app using SDL2 and the program is written in C++. when rendering textures using fonts i referenced null pointers to the font.
i will implement events in the future and if you have any suggestions or some advice leave it in the comments, the feedback helps me a lot!
anyways you might give it a try (i am sorry about the makefile not working, i built the app on windows and needed to link against the folder where sdl is located): https://github.com/zetef/calviewer3 -
I fucking cannot stand CMake. I hate this stupid fucking piece of software. I've been trying for 3 fucking days to get SDL2 to link just once and I cannot. It doesn't work in the slightest.
Every time I look for help I find a Stack Overflow post from 5 years ago about someone having the exact same problem and all of the responses are "This function is deprecated, use this instead"
THAT DOESNT SOLVE MY FUCKING ISSUE
WHY DOES CMAKE DEPRECATE THINGS EVERY 1.5 YEARS
THIS ACTUALLY MAKES ME WANT TO SWITCH TO INTERPRETED LANGUAGES I CANNOT STAND BUILD SYSTEMS
SURELY IT CANT BE THAT HARD
WE HAVE OPERATING SYSTEMS, AERODYNAMIC SIMULATIONS, AND A GLOBAL COMMUNICATIONS NETWORK BUT WE CANT FUCKING PASS COMMANDS TO GCC PROPERLY?????6 -
Worst dev experience of 2016: compiling and including SDL and SDL2 into C projects, never got it to run all the functions, sometimes wouldnt compile, etc... Never got it to work properly in the end...3
-
Look, C++, I love you and all, but I don't want to reboot my computer every time I mess something up.1
-
What's the most sensible way to build and use 32/64-bit libraries with MSYS on Windows? Specifically, I am wondering about zlib and libpng along with SDL2.
I know there are pre-built versions available, but I am inevitably going to need to build other libraries in future.
I'm expecting things to go into /usr/local (which they do), but I'd like to have separate builds for 32-bit and 64-bit. I know I can put things into "lib32" or "lib64" using ./configure options pretty easily, but DLLs (e.g. SDL) seem to end up in "bin" so I assume I should create a "bin32" and "bin64" for those?
Then there's the issue of e.g. libpng not being able to find zlib's headers when using its MSYS makefile... Should I be editing these makefiles? It looks as though I should (things are commented-out etc.) but when I want to update to a newer version, I'll need to modify the makefile again.
It probably sounds like a really silly set of questions but I've always found that building and installing libraries on Windows feels really clumsy and I just want to make sure I'm not making a really messy dev environment.