* Fixes for power, sidebar, etc.

* Padding on display?
This commit is contained in:
Ben Lankamp
2020-06-14 21:39:40 +02:00
parent a47304608b
commit c412287a3e
10 changed files with 83 additions and 114 deletions
+1 -2
View File
@@ -188,7 +188,7 @@ DisplayClass::DisplayClass(void) :
ShadowShapes = 0;
TransIconset = 0;
Set_View_Dimensions(0, 8, 320/CELL_PIXEL_W, 200/CELL_PIXEL_H);
Set_View_Dimensions(0, 0, ScreenWidth, ScreenHeight);
}
@@ -240,7 +240,6 @@ void DisplayClass::One_Time(void)
ShadowShapes = MFCD::Retrieve("SHADOW.SHP");
#endif
//PG Set_View_Dimensions(0, 8 * RESFACTOR);
Set_View_Dimensions(0, 0);
}
+2
View File
@@ -270,6 +270,8 @@ void GScreenClass::Flag_To_Redraw(bool complete)
*=============================================================================================*/
void GScreenClass::Input(KeyNumType & key, int & x, int & y)
{
if (this == NULL) return;
key = Keyboard->Check();
x = Keyboard->Mouse_X();
+4 -18
View File
@@ -407,19 +407,16 @@ void PaletteClass::Set(int time, void (* callback)(void)) const
** Set the palette to this intermediate palette and then loop back
** to calculate and set a new intermediate palette.
*/
#ifdef WIN32
Set_Palette((void*)&palette[0]);
#else
palette.Set();
#endif //WIN32
// This updates the screen
Device_Present();
/*
** If the callback routine was specified, then call it once per palette
** setting loop.
*/
if (callback) {
callback();
}
if (callback) callback();
/*
** This loop ensures that the palette won't be set more than once per game tick. Setting
@@ -435,16 +432,5 @@ void PaletteClass::Set(int time, void (* callback)(void)) const
** Ensure that the final palette exactly matches the requested
** palette before exiting the fading routine.
*/
#ifndef WIN32
Vsync();
RGBClass const * rgbptr = &Palette[0];
RGBClass::Raw_Color_Prep(0);
for (int index = 0; index < COLOR_COUNT; index++) {
rgbptr->Raw_Set();
rgbptr++;
}
((PaletteClass &)CurrentPalette) = *this;
#else //WIN32
Set_Palette((void*)&Palette[0]);
#endif
}
+19 -15
View File
@@ -138,7 +138,7 @@ void PowerClass::One_Time(void)
PowerButton.X = ScreenWidth - (640 - (POWER_X * RESFACTOR));
PowerButton.Y = POWER_Y * RESFACTOR;
PowerButton.Width = (POWER_WIDTH * RESFACTOR)-1;
PowerButton.Height = POWER_HEIGHT * RESFACTOR;
PowerButton.Height = ScreenHeight - ( POWER_Y * RESFACTOR ) ;// POWER_HEIGHT* RESFACTOR;
PowerShape = MFCD::Retrieve("POWER.SHP");
PowerBarShape = MFCD::Retrieve("POWERBAR.SHP");
}
@@ -180,24 +180,29 @@ void PowerClass::Draw_It(bool complete)
remap = Map.FadingRed;
}
// LogicPage->Fill_Rect(POWER_X, POWER_Y, POWER_X+POWER_WIDTH-1, POWER_Y+POWER_HEIGHT-1, LTGREY);
CC_Draw_Shape(PowerBarShape, 0, ScreenWidth - (640 - (240 * RESFACTOR)), 88 * RESFACTOR, WINDOW_MAIN, flags | SHAPE_NORMAL | SHAPE_WIN_REL, remap);
#ifdef WIN32
/*
** Hires power strip is too big to fit into a shape so it is in two parts
*/
CC_Draw_Shape(PowerBarShape, 1, ScreenWidth - (640 - (240 * RESFACTOR)), (88 * RESFACTOR) + (56*RESFACTOR), WINDOW_MAIN, flags | SHAPE_NORMAL | SHAPE_WIN_REL, remap);
#endif
CC_Draw_Shape(PowerBarShape, 0, ScreenWidth - (640 - (240 * RESFACTOR)), (88 * RESFACTOR), WINDOW_MAIN, flags | SHAPE_NORMAL | SHAPE_WIN_REL, remap);
int bottomOfBar = (88 * RESFACTOR) + 56;
while(bottomOfBar < PowerButton.Height + 34 )
{
CC_Draw_Shape(PowerBarShape, 1, ScreenWidth - (640 - (240 * RESFACTOR)), bottomOfBar, WINDOW_MAIN, flags | SHAPE_NORMAL | SHAPE_WIN_REL, remap);
bottomOfBar += 8 * RESFACTOR;
}
int bottom = ( PowerButton.Y * RESFACTOR ) + PowerButton.Height;
/*
** Determine how much the power production exceeds or falls short
** of power demands.
*/
int bottom = (POWER_Y + POWER_HEIGHT - 1) * RESFACTOR;
int power_height = (PowerHeight == DesiredPowerHeight) ? PowerHeight + (_modtable[PowerBounce] * PowerDir) : PowerHeight;
int drain_height = (DrainHeight == DesiredDrainHeight) ? DrainHeight + (_modtable[DrainBounce] * DrainDir) : DrainHeight;
power_height = Bound(power_height, 0, POWER_HEIGHT - 2);
drain_height = Bound(drain_height, 0, POWER_HEIGHT - 2);
power_height = Bound(power_height, 0, PowerButton.Height - 2);
drain_height = Bound(drain_height, 0, PowerButton.Height - 2);
/*
** Draw the power output graphic on top of the power bar framework.
@@ -222,14 +227,13 @@ void PowerClass::Draw_It(bool complete)
**
** ST - 5/2/96 11:23AM
*/
#ifdef WIN32
power_height = (power_height*(76*RESFACTOR+1)) / (53*RESFACTOR+1);
drain_height = (drain_height*(76*RESFACTOR+1)) / (53*RESFACTOR+1);
#endif
bottom = (175*RESFACTOR)+1;
LogicPage->Fill_Rect(ScreenWidth - (640 - (245*RESFACTOR)), bottom-power_height, ScreenWidth - (640 - (245*RESFACTOR+1)), bottom, color2);
LogicPage->Fill_Rect(ScreenWidth - (640 - (246*RESFACTOR)), bottom-power_height, ScreenWidth - (640 - (246*RESFACTOR+1)), bottom, color1);
//bottom = (175*RESFACTOR)+1;
LogicPage->Fill_Rect(ScreenWidth - (640 - (245*RESFACTOR)), bottom - power_height, ScreenWidth - (640 - (245*RESFACTOR+1)), bottom, color2 );
LogicPage->Fill_Rect(ScreenWidth - (640 - (246*RESFACTOR)), bottom - power_height, ScreenWidth - (640 - (246*RESFACTOR+1)), bottom, color1 );
}
/*
-5
View File
@@ -77,13 +77,8 @@ class PowerClass : public RadarClass
enum PowerEnums {
POWER_X=10*ICON_PIXEL_W,
#ifdef WIN32
POWER_Y= (7+70+13),
POWER_HEIGHT=(200-(7+70+13)),
#else
POWER_Y= (88+9),
POWER_HEIGHT=80,
#endif
POWER_WIDTH=8,
POWER_LINE_SPACE=5,
POWER_LINE_WIDTH=3,
+28 -35
View File
@@ -202,20 +202,9 @@ void SidebarClass::One_Time(void)
PowerClass::One_Time();
/*
** This sets up the clipping window. This window is used by the shape drawing
** code so that as the sidebar buildable buttons scroll, they get properly
** clipped at the top and bottom edges.
** Set up the coordinates for the sidebar strips. These coordinates are for
** the upper left corner.
*/
WindowList[WINDOW_SIDEBAR][WINDOWX] = (SIDE_X + 8);
WindowList[WINDOW_SIDEBAR][WINDOWY] = SIDE_Y + 1 + TOP_HEIGHT;
WindowList[WINDOW_SIDEBAR][WINDOWWIDTH] = SIDE_WIDTH;
WindowList[WINDOW_SIDEBAR][WINDOWHEIGHT] = StripClass::MAX_VISIBLE * StripClass::OBJECT_HEIGHT;
// WindowList[WINDOW_SIDEBAR][WINDOWHEIGHT] = StripClass::MAX_VISIBLE * StripClass::OBJECT_HEIGHT-1;
/*
** Set up the coordinates for the sidebar strips. These coordinates are for
** the upper left corner.
*/
new (&Column[0]) StripClass(InitClass());
new (&Column[1]) StripClass(InitClass());
@@ -238,7 +227,7 @@ void SidebarClass::One_Time(void)
WindowList[WINDOW_SIDEBAR][WINDOWX] = ((SIDE_X+8)) * RESFACTOR;
WindowList[WINDOW_SIDEBAR][WINDOWY] = (SIDE_Y + 1 + TOP_HEIGHT) * RESFACTOR;
WindowList[WINDOW_SIDEBAR][WINDOWWIDTH] = (SIDE_WIDTH) * RESFACTOR;
WindowList[WINDOW_SIDEBAR][WINDOWHEIGHT] = (StripClass::MAX_VISIBLE * StripClass::OBJECT_HEIGHT) * RESFACTOR;
WindowList[WINDOW_SIDEBAR][WINDOWHEIGHT] = ScreenHeight;
// WindowList[WINDOW_SIDEBAR][WINDOWHEIGHT] = (StripClass::MAX_VISIBLE * StripClass::OBJECT_HEIGHT-1) * RESFACTOR;
/*
@@ -327,11 +316,7 @@ void SidebarClass::Init_IO(void)
Upgrade.IsSticky = true;
Upgrade.ID = BUTTON_UPGRADE;
#ifdef WIN32
Upgrade.X = ScreenWidth - (640 - 0x21f);
#else
Upgrade.X = ((0x21f/2)+1)*RESFACTOR;
#endif
Upgrade.Y = (0x96/2)*RESFACTOR;
Upgrade.IsPressed = false;
Upgrade.IsToggleType = true;
@@ -791,8 +776,11 @@ void SidebarClass::Draw_It(bool complete)
** The sidebar shape is too big in 640x400 so it needs to be drawn in three chunks.
*/
CC_Draw_Shape(SidebarShape, 0, SIDE_X * RESFACTOR, 8*RESFACTOR, WINDOW_MAIN, SHAPE_WIN_REL);
// @@ this one repeats
CC_Draw_Shape(SidebarMiddleShape, shape, SIDE_X * RESFACTOR, (8+80)*RESFACTOR, WINDOW_MAIN, SHAPE_WIN_REL);
CC_Draw_Shape(SidebarBottomShape, shape, SIDE_X * RESFACTOR, (8+80+50)*RESFACTOR, WINDOW_MAIN, SHAPE_WIN_REL);
CC_Draw_Shape(SidebarBottomShape, shape, SIDE_X * RESFACTOR, ScreenHeight - ( 80*RESFACTOR ), WINDOW_MAIN, SHAPE_WIN_REL);
Repair.Draw_Me(true);
Upgrade.Draw_Me(true);
@@ -1042,7 +1030,7 @@ bool SidebarClass::Activate(int control)
** activate it on the left side of the screen.
*/
if (IsSidebarActive /*&& X*/) {
Set_View_Dimensions(0, 8 * RESFACTOR, (((ScreenWidth/2)-SIDE_WIDTH)/ICON_PIXEL_W) * RESFACTOR);
Set_View_Dimensions(0, 0, (((ScreenWidth/2)-SIDE_WIDTH)/ICON_PIXEL_W) * RESFACTOR);
IsToRedraw = true;
Help_Text(TXT_NONE);
Repair.Zap();
@@ -1061,7 +1049,7 @@ bool SidebarClass::Activate(int control)
Add_A_Button(Map.PowerButton);
} else {
Help_Text(TXT_NONE);
Set_View_Dimensions(0, 8 * RESFACTOR);
Set_View_Dimensions(0, 0);
Remove_A_Button(Repair);
Remove_A_Button(Upgrade);
Remove_A_Button(Zoom);
@@ -1137,6 +1125,10 @@ SidebarClass::StripClass::StripClass(InitClass const & ) :
*=============================================================================================*/
void SidebarClass::StripClass::One_Time(int )
{
// Sidebar height
HEIGHT = ScreenHeight;
MaxButtonsVisible = ( HEIGHT - ( ( SIDE_Y + TOP_HEIGHT + OBJECT_HEIGHT ) * RESFACTOR ) ) / ( OBJECT_HEIGHT * RESFACTOR );
/*
** Sidebar is player team specific in Hires
*/
@@ -1231,8 +1223,8 @@ void SidebarClass::StripClass::Init_IO(int id)
UpButton[ID].IsSticky = true;
UpButton[ID].ID = BUTTON_UP+id;
UpButton[ID].X = X+(UP_X_OFFSET * RESFACTOR);
UpButton[ID].Y = Y+(UP_Y_OFFSET * RESFACTOR);
UpButton[ID].X = X + (UP_X_OFFSET * RESFACTOR);
UpButton[ID].Y = HEIGHT - ( ( OBJECT_HEIGHT + 7 ) * RESFACTOR );
#if (FRENCH)
#ifdef WIN32
@@ -1246,8 +1238,8 @@ void SidebarClass::StripClass::Init_IO(int id)
DownButton[ID].IsSticky = true;
DownButton[ID].ID = BUTTON_DOWN+id;
DownButton[ID].X = X+(DOWN_X_OFFSET * RESFACTOR);
DownButton[ID].Y = Y+(DOWN_Y_OFFSET * RESFACTOR);
DownButton[ID].X = X + (DOWN_X_OFFSET * RESFACTOR);
DownButton[ID].Y = HEIGHT - ( (OBJECT_HEIGHT + 7 ) * RESFACTOR );
/*
** Buttons are in a slightly different position in the new sidebar
@@ -1257,7 +1249,7 @@ void SidebarClass::StripClass::Init_IO(int id)
DownButton[ID].Set_Shape(MFCD::Retrieve("STRIPDN.SHP"));
for (int index = 0; index < MAX_VISIBLE; index++) {
for (int index = 0; index < MaxButtonsVisible; index++) {
SelectClass & g = SelectButton[ID][index];
g.ID = BUTTON_SELECT;
g.X = X;
@@ -1266,7 +1258,6 @@ void SidebarClass::StripClass::Init_IO(int id)
g.Height = OBJECT_HEIGHT * RESFACTOR;
g.Set_Owner(*this, index);
}
}
@@ -1371,7 +1362,7 @@ void SidebarClass::StripClass::Activate(void)
DownButton[ID].Zap();
Map.Add_A_Button(DownButton[ID]);
for (int index = 0; index < MAX_VISIBLE; index++) {
for (int index = 0; index < MaxButtonsVisible; index++) {
SelectButton[ID][index].Zap();
Map.Add_A_Button(SelectButton[ID][index]);
}
@@ -1397,7 +1388,7 @@ void SidebarClass::StripClass::Deactivate(void)
{
Map.Remove_A_Button(UpButton[ID]);
Map.Remove_A_Button(DownButton[ID]);
for (int index = 0; index < MAX_VISIBLE; index++) {
for (int index = 0; index < MaxButtonsVisible; index++) {
Map.Remove_A_Button(SelectButton[ID][index]);
}
}
@@ -1467,7 +1458,7 @@ bool SidebarClass::StripClass::Scroll(bool up)
if (!TopIndex) return(false);
Scroller--;
} else {
if (TopIndex+MAX_VISIBLE >= BuildableCount) return(false);
if ( TopIndex+ MaxButtonsVisible >= BuildableCount ) return(false);
Scroller++;
}
return(true);
@@ -1544,7 +1535,7 @@ bool SidebarClass::StripClass::AI(KeyNumType & input, int , int )
** logic handler. This might result in up or down scrolling.
*/
if (!IsScrolling && Scroller) {
if (BuildableCount <= MAX_VISIBLE) {
if (BuildableCount <= MaxButtonsVisible ) {
Scroller = 0;
} else {
@@ -1565,7 +1556,7 @@ bool SidebarClass::StripClass::AI(KeyNumType & input, int , int )
}
} else {
if (TopIndex+MAX_VISIBLE >= BuildableCount) {
if (TopIndex + MaxButtonsVisible >= BuildableCount) {
Scroller = 0;
} else {
Scroller--;
@@ -1710,8 +1701,8 @@ void SidebarClass::StripClass::Draw_It(bool complete)
/*
** New sidebar needs to be drawn not filled
*/
if (BuildableCount < MAX_VISIBLE) {
CC_Draw_Shape(LogoShapes, ID, X+(2*RESFACTOR), Y, WINDOW_MAIN, SHAPE_WIN_REL|SHAPE_NORMAL, 0);
if ( BuildableCount < MaxButtonsVisible ) {
CC_Draw_Shape( LogoShapes, ID, X+(2*RESFACTOR), Y, WINDOW_MAIN, SHAPE_WIN_REL|SHAPE_NORMAL, 0);
}
/*
@@ -1724,7 +1715,7 @@ void SidebarClass::StripClass::Draw_It(bool complete)
** Loop through all the buildable objects that are visible in the strip and render
** them. Their Y offset may be adjusted if the strip is in the process of scrolling.
*/
for (int i = 0; i < MAX_VISIBLE + (IsScrolling ? 1 : 0); i++) {
for (int i = 0; i < MaxButtonsVisible + (IsScrolling ? 1 : 0); i++) {
bool production;
bool completed;
int stage;
@@ -2051,6 +2042,8 @@ void SidebarClass::StripClass::SelectClass::Set_Owner(StripClass & strip, int in
*=============================================================================================*/
int SidebarClass::StripClass::SelectClass::Action(unsigned flags, KeyNumType & key)
{
if (Strip == NULL) return 0;
int index = Strip->TopIndex + Index;
RTTIType otype = Strip->Buildables[index].BuildableType;
int oid = Strip->Buildables[index].BuildableID;
+15 -17
View File
@@ -51,7 +51,7 @@ extern int ScreenWidth;
#define COLUMN_ONE_X (int)((SIDE_X) + 8) // Sidestrip upper left coordinates...
#define COLUMN_ONE_Y (int)(SIDE_Y + (TOP_HEIGHT))
#define COLUMN_TWO_X (int)((SIDE_X) + 8 + ((80 - 16) / 2) + 3)
#define COLUMN_TWO_Y (int)(7 + 70 + 13)
#define COLUMN_TWO_Y (int)(SIDE_Y + (TOP_HEIGHT))
#define BUTTON_ONE_WIDTH 32 // Button width.
#define BUTTON_TWO_WIDTH 20 // Button width.
#define BUTTON_THREE_WIDTH 20 // Button width.
@@ -62,6 +62,7 @@ extern int ScreenWidth;
#define BUTTON_TWO_Y (int)(SIDE_Y + 2) // Right button Y coordinate.
#define BUTTON_THREE_X (int)(SIDE_X + 58) // Right button X coordinate.
#define BUTTON_THREE_Y (int)(SIDE_Y + 2) // Right button Y coordinate.
class SidebarClass: public PowerClass
{
public:
@@ -190,37 +191,34 @@ class SidebarClass: public PowerClass
BUTTON_UP=200,
BUTTON_DOWN=210,
BUTTON_SELECT=220,
MAX_BUILDABLES=75, // Maximum number of object types in sidebar.
MAX_BUILDABLES=75, // Maximum number of object types in sidebar.
OBJECT_HEIGHT=24, // Pixel height of each buildable object.
OBJECT_WIDTH=32, // Pixel width of each buildable object.
STRIP_WIDTH=35, // Width of strip (not counting border lines).
MAX_VISIBLE=4, // Number of object slots visible at any one time.
#ifdef WIN32
SCROLL_RATE=12, // The pixel jump while scrolling (larger is faster).
#else
SCROLL_RATE=8, // The pixel jump while scrolling (larger is faster).
#endif
STRIP_WIDTH=35, // Width of strip (not counting border lines).
MAX_VISIBLE=24, // Number of object slots visible at any one time (theoretical, actual is calculated later)
SCROLL_RATE=12, // The pixel jump while scrolling (larger is faster).
UP_X_OFFSET=2, // Scroll up arrow coordinates.
#ifdef WIN32
UP_Y_OFFSET=int(MAX_VISIBLE)*int(OBJECT_HEIGHT)+1,
#else
UP_Y_OFFSET=int(MAX_VISIBLE)*int(OBJECT_HEIGHT)+2,
#endif
//UP_Y_OFFSET=int(MAX_VISIBLE)*int(OBJECT_HEIGHT)+1,
DOWN_X_OFFSET=18, // Scroll down arrow coordinates.
DOWN_Y_OFFSET=UP_Y_OFFSET,//BGint(MAX_VISIBLE)*int(OBJECT_HEIGHT)+1,
//DOWN_Y_OFFSET=UP_Y_OFFSET, // BGint(MAX_VISIBLE)*int(OBJECT_HEIGHT)+1,
SBUTTON_WIDTH=16, // Width of the mini-scroll button.
SBUTTON_HEIGHT=12, // Height of the mini-scroll button.
LEFT_EDGE_OFFSET=2, // Offset from left edge for building shapes.
LEFT_EDGE_OFFSET=2, // Offset from left edge for building shapes.
TEXT_X_OFFSET=18, // X offset to print "ready" text.
TEXT_Y_OFFSET=15, // Y offset to print "ready" text.
TEXT_COLOR=255 // Color to use for the "Ready" text.
};
int MaxButtonsVisible;
/*
** This is the coordinate of the upper left corner that this side strip
** uses for rendering.
*/
int X,Y;
int X,Y,HEIGHT;
/*
** This is a unique identifier for the sidebar strip. Using this identifier,
+1 -15
View File
@@ -652,10 +652,6 @@ int PASCAL WinMain ( HINSTANCE instance , HINSTANCE , char * command_line , int
Main_Game(argc, argv);
if (RunningAsDLL) { //PG
return (EXIT_SUCCESS);
}
#ifdef MPEGMOVIE // Denzil 6/15/98
if (MpgSettings != NULL)
delete MpgSettings;
@@ -666,16 +662,11 @@ int PASCAL WinMain ( HINSTANCE instance , HINSTANCE , char * command_line , int
#endif
#endif
#ifdef WIN32
VisiblePage.Clear();
HiddenPage.Clear();
#else //WIN32
SeenPage.Clear();
Set_Video_Mode(RESET_MODE);
#endif //WIN32
Memory_Error_Exit = Print_Error_Exit;
#ifdef WIN32
/*
** Flag that this is a clean shutdown (not killed with Ctrl-Alt-Del)
*/
@@ -699,11 +690,6 @@ int PASCAL WinMain ( HINSTANCE instance , HINSTANCE , char * command_line , int
} while (ReadyToQuit == 1);
return (EXIT_SUCCESS);
#else //WIN32
Remove_Mouse();
Sound_End();
#endif //WIN32
} else {
if (!RunningFromEditor)
{
+3 -2
View File
@@ -109,11 +109,12 @@ void TabClass::Draw_It(bool complete)
** Use the new sidebar art for 640x400
*/
CC_Draw_Shape(TabShape, 0, 0, 0, WINDOW_MAIN, SHAPE_NORMAL);
Fancy_Text_Print(TXT_TAB_BUTTON_CONTROLS, (EVA_WIDTH / 2) * RESFACTOR, 0, &MetalScheme, TBLACK, TPF_METAL12 | TPF_CENTER | TPF_USE_GRAD_PAL);
Draw_Credits_Tab();
LogicPage->Draw_Line(0, tab_height-(1* RESFACTOR), rightx, tab_height-(1 * RESFACTOR), BLACK);
Fancy_Text_Print(TXT_TAB_BUTTON_CONTROLS, (EVA_WIDTH/2) * RESFACTOR, 0, &MetalScheme, TBLACK, TPF_METAL12 | TPF_CENTER | TPF_USE_GRAD_PAL);
if (!IsSidebarActive)
{
+10 -5
View File
@@ -163,9 +163,8 @@ void ImGui_NewFrame(void) {
ImGui_ImplSDL2_NewFrame(game_window);
}
void Device_Present(void) {
void Device_Present(void)
{
// Rasterize the palette.
for (int i = 0; i < ScreenWidth * ScreenHeight; i++) {
backbuffer_data[(i * 4) + 0] = backbuffer_palette[(backbuffer_data_raw[i] * 3) + 0];
@@ -173,6 +172,7 @@ void Device_Present(void) {
backbuffer_data[(i * 4) + 2] = backbuffer_palette[(backbuffer_data_raw[i] * 3) + 2];
backbuffer_data[(i * 4) + 3] = 255;
}
glBindTexture(GL_TEXTURE_2D, backbuffer_texture);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, ScreenWidth, ScreenHeight, GL_RGBA, GL_UNSIGNED_BYTE, backbuffer_data);
@@ -181,8 +181,11 @@ void Device_Present(void) {
bool ScreenActive;
ImGuiStyle& style = ImGui::GetStyle();
style.FramePadding = ImVec2(0, 0);
ImGui::SetNextWindowSize(ImVec2(ScreenWidth, ScreenHeight));
ImGui::SetNextWindowPos(ImVec2(0, 0));
// @@ wtf? padding?
ImGui::SetNextWindowSize(ImVec2(ScreenWidth+12, ScreenHeight + 12));
ImGui::SetNextWindowPos(ImVec2(-8, -8));
ImGui::Begin("RenderWindow", &ScreenActive, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar);
ImVec2 desktopSize(ScreenWidth, ScreenHeight);
ImGui::Image((ImTextureID)backbuffer_texture, desktopSize);
@@ -583,11 +586,13 @@ void Create_Main_Window ( HANDLE instance , int command_show , int width , int h
glGenTextures(1, &backbuffer_texture);
glBindTexture(GL_TEXTURE_2D, backbuffer_texture);
// Give the image to OpenGL
backbuffer_data = new byte[width * height * 4];
memset(backbuffer_data, 0, width * height * 4);
backbuffer_data_raw = new byte[width * height];
memset(backbuffer_data_raw, 0, width * height);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, backbuffer_data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);