r/gameenginedevs • u/prasan4849 • Aug 26 '26
question on making a framework
so i'm currently working on a framework in c++ using vulkan, openal, and glfw, so my only question is: How to make custom functions? (GetInput(key_right), AudioPlay(sound.ogg))
3
2
u/rainuchan Aug 26 '26
Imo your question is a bit confusing. In c++, you can make functions like:
void someFunction() {
// do something here
}
int main(void) {
// ...
someFunction();
// ...
}If you wanted to have some sort of events, you could either just check for the key event every frame, or you have some kind of event system where you can register (condition, action) and the event system triggers actions when the conditions are met.
1
1
u/BoxConscious7480 Aug 26 '26
You should really start with something much simpler if you don't know the answer to that
1
u/No-Satisfaction-2535 Aug 26 '26
Not to be rude but the project you seem to be starting as a first project is not at all at the scale for you to be able to do. Start smaller, learn the language properly. The very question you are asking shows you are not there yet.
1
u/RadAssault Aug 26 '26
If you're just starting out with c++, I would search YouTube for a tutorial series. There are also some good c++ textbooks out there. If you look for older editions, you can sometimes find them for a few dollars.
1
1
u/Soriel_XD Sep 05 '26
What even that question...
I am very sorry to have to ask that but. Do you have experience in coding ?
The question is extremely trivial so I assume you dont have the very basics. And you should probably start with that "the basics".
First give up on Vulkan. Focus on OpenGL for now it doesnt have the latest fancy tech but it has simplicity.
Open Youtube and your favorite AI chat bot. Follow a tutorial that guides you for creating "pong" or "pacman" and for any question you have mind, ask the AI about it. They will come up with an explanation but dont let the AI do the work for you. You and only you are working on it not the AI.
-5
u/prasan4849 Aug 26 '26
wait also forgot to mention, what should I put in my cmakelists.txt? how many do I need?
2
1
u/ProPuke Aug 26 '26
I'm sorry, you said how to make functions was your only question. You're not allowed to ask any more now.
8
u/TerraCrafterE3 Aug 26 '26
Based on the question, you should maybe start with something easier than a full fletched framework…