Giter VIP home page Giter VIP logo

thriftcalculator's Introduction

ThriftCalculator

Fun little calculator that uses Thrift, Imgui, Glad, and SDL. This is basically an extended version of the C++ Thrift Calculator tutorial to gain a better understanding of how to use thrift with a GUI appilication.

image

The client in this case is the Calculator, using ImGui, GLAD, and SDL to create the required buttons, window, etc. The server side does all the calculations. When the = is pushed, a call is made to the server to calculate the chosen numbers. The Server and Client are their own separate programs. The server must be running in order to get the client to work.

The calculator is only a simple calculator and is only to demonstrate the client-server relationship using thrift. It can definitely be extended to add more functionalities, etc.

Requirements

  • GLAD
  • ImGui
  • SDL
  • Thrift Libraries and Compiler

VCPKG

If you have vcpkg you can install the required thirft libraries with the following from the CMD LINE:

  • vcpkg install thrift:x64-windows

Or you can build them from source: Thrift Source

Thrift Compiler

  • You can get the thrift compiler from here: Thrift Download
  • The thrift compiler will have the version in the name, I recommend renaming the file to thrift.exe for simplicity.
  • Once you have the thrift.exe, put in in a good location like C:\thrift\thrift.exe
  • Then you are going to want to set the path as a system variable so you can call thrift from any CMD Line

image image image

  • If the path is not set, in Visual Studio the Custom Build Tool for the thrift files will have to be changed to accommodate where your thrift compiler is located.
  • Go to the properties of the calculator.thrift file and adjust the command line arguments to use the path where your thrift compiler is located

image

You can change the CMD Line arguments to something like below: C:\thrift\thrift.exe -gen cpp -o . $(ProjectDir)thrift\%(Filename)%(Extension) -- Use your filepath for thrift.

Build

  • Once the above requirements have been set, you should be able to build the VS sln.
  • If everything builds successfully, go to the build folder and run the Server.exe. If the server is not running when trying to run the Client Calculator, the client will fail to run.
  • Once the server is running, you can now locally run the visual studio solution and use the calculator.

thriftcalculator's People

Contributors

dwjclark11 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.