🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How to make a calculator

Started by
26 comments, last by SuperVGA 3 years, 10 months ago

As I recall, android phones use a flavor of Java (see here for a list of langauges you can use to program android: https://www.geeksforgeeks.org/top-programming-languages-for-android-app-development/​ ), each of these languages has one or more frameworks for developing GUI's with. I'd suggest researching each and seeing what is best suited to you needs. For example here is a calculator app written in C# :https://github.com/JonathanMoreno14/Calculator-App-Xamarin-Android​ for you to study.

From what I recall, iPhone uses either swift or objective-C. Both these have frameworks for building GUI. You can check out this page https://github.com/JonathanMoreno14/Calculator-App-Xamarin-Android.

Finally for openGL, I'm not sure if either android or iPhone support openGL exactly. Android phones support using openGL-ES (see https://developer.android.com/guide/topics/graphics/opengl#:~:text=Android%20includes%20support%20for%20high,for%203D%20graphics%20processing%20hardware.​ ). I've never used openGL-ES so I'm not sure how close it is to ‘desktop’ openGL.

On iPhone, the issue is more murky – we have this article from 2018 - https://www.anandtech.com/show/12894/apple-deprecates-opengl-across-all-oses​ -saying that openGL is deprecated across all apple platforms. While the Apple web site still has documentation on openGL, well exactly openGL-ES, their pages redirect you to the documentation on Metal (https://developer.apple.com/metal/​ ).

Advertisement

@undefined i dont want to switch. Microsoft is made with c++. I want to make buttons and text boxes and calculators, etc with opengl imgui

@undefined So let's get on point I want to make buttons like there are in Microsoft and calculator too

Shaanveer said:
What why. I just need to know how to render multiple buttons with any shapes and a display box. I know the rest how to remove top. And rest just need to know this.

Because your topic name and the first topic message contains nothing about ImGUI. If you do not like to make it in OpenGL/Freetype you can make a calculator in ImGUI. But you did not show where are a problem in your code and you did not show your code with problem. It is difficult to help to solve your problem in your code. If you a beginner in ImGUI you should study it from scratch. You should try to make something. For example you should to position one button. You should show us a code where you are trying to position one of few buttons and displaying label.

@undefined oh soo u want to know what he suppose to do? Just send some code on how to render multiple buttons on different positions with any shapes and a display box. And now if u think u cant make this with opengl. And imgui. Well microsoft was made with opengl and c++ and maybe imgui I'm not sure

Did you try to display the “hello, world” string in a window with ImGUI?

@shaanveer please take yet another while to reconsider. Or continue to pretend to do so. I keep making the mistake of checking on you to see if you've progressed, and while I do realise that I could just not do that, I also want you to show some proper work. For you to achieve something.

But you're stuck in a loop, and unless you dig into ImGui yourself (and C++ for that matter) and really absorb through little projects, you're not going to get anywhere soon. Your threads are toxic and people have your interests at heart.

I understand that it can be difficult to take, and the below responses probably won't help much, besides showing the hypocrisy you've delivered so far.

Shaanveer said:

What why. I just need to know how to render multiple buttons with any shapes and a display box. I know the rest how to remove top. And rest just need to know this.

If you have to put it like that over and over again then No; You don't “just” need to know it. You need to know a lot more than that, and you need to get started instead of repeating the same vague questions about buttons here over and over again.

Shaanveer said:

@8Observer8 Why would I need this when I have imgui. Why are you adding additional things that have nothing to do with the problem. I just need a display box and multiple buttons with any shape(2 things).

Why have you been adding additional things that have nothing to do with the problem? You're making it difficult for yourself. @8observer8 also provided you with a fairly simple js example that you could have learned from, and godot and game make that I've mentioned repeatedly makes button placements easier. Why are you hell-bent on making it so difficult for yourself while expecting us to tackle every tiny, google-able, RTFM-ly, stack-overflow-hack-provided, RFC-detailed issue you come across?

Shaanveer said:

@undefined Just send some code on how to render multiple buttons on different positions with any shapes and a display box.

No script kiddie - tinker with stuff and learn instead! Don't expect anyone to deliver everything for you on a silver plattter. @8observer8 has been very, very generous with sample code, and very patient.

Shaanveer said:

Well microsoft was made with opengl and c++ and maybe imgui I'm not sure

Of course you're not sure. Because you have absolutely no idea, and a falsity about something being “the right way” is causing you to make bad decisions. 1) Microsoft what exactly? 2) OpenGL? Sure, but don't you think MS tends to favour DirectX? 3) C++? What about the big investments on C# and TypeScript from Microsoft? 4) Dear ImGui? Again I must ask what for - the Dear ImGui sponsors are listed here. I acknowledge using C++ and ImGui, and I like them a lot, I just don't think you should be using them yet. Not with what you've written here so far.

Shaanveer said:

@undefined Then can you tell me the framework gui library that allows this. I don't want to change opengl but if I have to for better results I will. But I am fine to change gui library. Is it commen or any one no one knows. Try telling me a common on.

Use a game engine or get cracking on making anything, heck!

This topic is closed to new replies.

Advertisement