// Windowing Test App - test.cpp
// Creates window and draws a gradient
// Created by John Ryland (jryland@xiaofrog.com), 29/10/2017
// Copyright (c) 2017 InvertedLogic
// All rights reserved.
#include <cstdio>
#include "windowing.h"
class MyWindow : public Window
{
public:
void onDraw(int x1, int y1, int x2, int y2)
{
for (int j = 0; j < getHeight(); j++)
{
for (int i = 0; i < getWidth(); i++)
{
((uint32_t*)buffer.pixels.data())[j*x2+i] = pixelVal(255, i>>1, i>>1, i>>1);
}
}
}
};
class MyApp : public Application
{
public:
void onStart()
{
window.create(480, 650);
}
MyWindow window;
};
int main(int argc, char ** argv)
{
MyApp app;
return app.run();
}