*/}}

ourpaint.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Our Paint: A light weight GPU powered painting program.
  3. * Copyright (C) 2022-2023 Wu Yiming
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "ourpaint.h"
  19. extern LA MAIN;
  20. extern tnsMain* T;
  21. extern OurPaint *Our;
  22. int main(int argc, char *argv[]){
  23. laProcessInitArguments(argc, argv);
  24. laGetReadyWith(4,5,0);
  25. if(!ourInit()){ laShutoff(0); return -1; }
  26. laRefreshUDFRegistries();
  27. laEnsureUserPreferences();
  28. laLoadHyperResources("OURBRUSH");
  29. for(int i=1;i<argc;i++){
  30. char* file=argv[i];
  31. laManagedUDF* m; laUDF* udf = laOpenUDF(file, 1, 0, &m);
  32. if(udf){ laExtractUDF(udf,m,LA_UDF_MODE_APPEND,0); laCloseUDF(udf); }
  33. }
  34. //laAddRootDBInst("la.input_mapping");
  35. //laAddRootDBInst("la.drivers");
  36. //laAddRootDBInst("our.tools");
  37. if(!MAIN.Windows.pFirst){
  38. laWindow* w = laDesignWindow(-1,-1,35*LA_RH,25*LA_RH);
  39. laLayout* l = laDesignLayout(w, "Our Paint");
  40. laBlock* b = l->FirstBlock;
  41. laSplitBlockHorizon(b,0.7);
  42. laCreatePanel(b->B1, "panel_canvas");
  43. laBlock* br=b->B2;
  44. laSplitBlockVertical(br,0.6);
  45. laCreatePanel(br->B1, "panel_color");
  46. laCreatePanel(br->B1, "panel_tools");
  47. laCreatePanel(br->B1, "panel_brushes");
  48. laCreatePanel(br->B2, "panel_layers");
  49. laStartWindow(w);
  50. }
  51. our_EnableSplashPanel();
  52. laMainLoop();
  53. }