mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-01-02 12:17:51 -05:00
Not confirmed working as of yet, but at least it builds and --list-devices works. Code originally taken from Sam Lewis (@sam-masaki on gitlab.com), see: https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/9
50 lines
1.9 KiB
C++
50 lines
1.9 KiB
C++
/******************************************************************************************\
|
|
* *
|
|
* main.cpp *
|
|
* *
|
|
* Main function for OpenAuraSDK GUI project *
|
|
* *
|
|
\******************************************************************************************/
|
|
|
|
#include "OpenRGB.h"
|
|
#include "RGBController.h"
|
|
#include "i2c_smbus.h"
|
|
#include <vector>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#include "OpenRGBDialog2.h"
|
|
|
|
|
|
extern std::vector<i2c_smbus_interface*> busses;
|
|
extern std::vector<RGBController*> rgb_controllers;
|
|
|
|
// See cli.cpp
|
|
extern int cli_main(int argc, char *argv[]);
|
|
|
|
/******************************************************************************************\
|
|
* *
|
|
* main *
|
|
* *
|
|
* Main function. Detects busses and Aura controllers, then opens the main window *
|
|
* *
|
|
\******************************************************************************************/
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
if (argc > 1 && strcmp(argv[1], "--gui"))
|
|
{
|
|
return cli_main(argc, argv);
|
|
}
|
|
|
|
DetectRGBControllers();
|
|
|
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
QApplication a(argc, argv);
|
|
|
|
Ui::OpenRGBDialog2 dlg(busses, rgb_controllers);
|
|
dlg.show();
|
|
|
|
return a.exec();
|
|
}
|