plotWindow.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. 2D FDTD simulator
  3. Copyright (C) 2019 Emilia Blåsten
  4. This program is free software: you can redistribute it and/or
  5. modify it under the terms of the GNU Affero General Public License
  6. as published by the Free Software Foundation, either version 3 of
  7. the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Affero General Public License for more details.
  12. You should have received a copy of the GNU Affero General Public
  13. License along with this program. If not, see
  14. <http://www.gnu.org/licenses/>.
  15. */
  16. /* plotWindow.h: Header file that defines the plotWindow structure. This
  17. * structure will be passed along with a Grid-structute to plotting
  18. * functions in plot2d.c. The goal is to let the plotting function have
  19. * to only decide what is plotted from the data, which comes from a
  20. * Grid-structure. The function is also passed a plotWindow-structure so
  21. * it knows in which window are we supposed to plot. */
  22. #ifndef _PLOTWINDOW_H
  23. #define _PLOTWINDOW_H
  24. #include <SDL2/SDL.h>
  25. struct plotWindow {
  26. char *title;
  27. int width, height;
  28. SDL_Window *window;
  29. SDL_Renderer *renderer;
  30. SDL_Texture *texture;
  31. SDL_Surface *surface;
  32. double minf, maxf;
  33. double red1, green1, blue1; //this colour corresponds to minf
  34. double red2, green2, blue2; //this colour corresponds to maxf
  35. };
  36. typedef struct plotWindow plotWindow;
  37. plotWindow* createPlotWindow(int x, int y, int width, int height, char *title);
  38. int wantToStopPlot();
  39. void destroyPlotWindow(plotWindow *plotter);
  40. void quitAllPlotting();
  41. #endif