Include C++ building for olcGameEngine

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 2 years ago
parent ba6af6dad3
commit f512eb5f67
  1. 7
      C++/scripts/build.sh
  2. 20
      C++/scripts/commit.sh
  3. BIN
      CProjectTemplate
  4. 5
      main.c
  5. 37
      main.cpp
  6. 6191
      pixelGameEngine.h
  7. 4
      sig
  8. 2
      utils/main.sh
  9. 4
      utils/md5

@ -0,0 +1,7 @@
#Compiles the entire program then runs it, producing an executable.
#C
printf "Running program...\n\n\n"
if g++ $(find . -type f -name "*.cpp") ${CUSTOM_PARAMS} -o ${PROJECT_NAME}; then
./${PROJECT_NAME} "$@"
fi
printf "\n\n"

@ -0,0 +1,20 @@
#Adds a commit message and pushes project to github repository.
#C
COMMIT_MESSAGE="$*"
FIRST_LINE=true
while IFS= read -r line
do
if [ "$FIRST_LINE" = true ]; then
COMMIT_MESSAGE+="
Co-authored-by: $line"
FIRST_LINE=false
else
COMMIT_MESSAGE+="
Co-authored-by: $line"
fi
done < utils/.coauthors
git add -u
git add *
git commit -m "$COMMIT_MESSAGE"
git push

Binary file not shown.

@ -1,5 +0,0 @@
#include <stdio.h>
int main(int argc,char**argv) {
printf("Hello World!");
}

@ -0,0 +1,37 @@
#define OLC_PGE_APPLICATION
#include "pixelGameEngine.h"
class Example : public olc::PixelGameEngine
{
public:
Example()
{
sAppName = "Example";
}
public:
bool OnUserCreate() override
{
// Called once at the start, so create things here
return true;
}
bool OnUserUpdate(float fElapsedTime) override
{
// called once per frame
for (int x = 0; x < ScreenWidth(); x++)
for (int y = 0; y < ScreenHeight(); y++)
Draw(x, y, olc::Pixel(rand() % 255, rand() % 255, rand()% 255));
return true;
}
};
int main()
{
Example demo;
if (demo.Construct(256, 240, 4, 4))
demo.Start();
return 0;
}

File diff suppressed because it is too large Load Diff

4
sig

@ -3,7 +3,7 @@ export AUTO_UPDATE=true
source utils/define.sh source utils/define.sh
define PROJECT_NAME "CProjectTemplate" define PROJECT_NAME "CProjectTemplate"
define CUSTOM_PARAMS "-lncurses" define CUSTOM_PARAMS "-lpng -lGL -lX11"
define LANGUAGE "C" define LANGUAGE "C++"
source utils/main.sh source utils/main.sh

@ -25,4 +25,4 @@ if [ -z "$1" ]
exit exit
fi fi
./$LANGUAGE/scripts/$1.sh "${*:2}" ./$LANGUAGE/scripts/$1.sh "${@:2}"

@ -1,4 +1,4 @@
define.sh:3ecab0dffe2adfb950f3eb7c7061b750 - define.sh:3ecab0dffe2adfb950f3eb7c7061b750 -
main.sh:d3d1bd0b56d8114eb7479964227f8576 - main.sh:4e6e9f0650ec790ce2c4364db94f0caa -
search.sh:81d08f5ff48e8a44b5f68387d426da05 - search.sh:30e1842e9a13452ea883bb6516d28e1c -
.updateDirectories:fa5e95db12be22ae8aed7ecbc560e38c - .updateDirectories:fa5e95db12be22ae8aed7ecbc560e38c -

Loading…
Cancel
Save