/SleekThink.cbp
Cannot display: file marked as a binary type.
svn:mime-type = application/xml
/SleekThink.depend
77584,7 → 77584,7
1420904071 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/statictext.h
"frame.h"
 
1420769676 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/window.h
1423622358 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/window.h
"button.h"
 
1421726113 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/cursor.h
77603,7 → 77603,7
 
1422762241 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/light.h
 
1423336301 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameMenu.cpp
1423622857 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameMenu.cpp
"GameCore.h"
"GameMenu.h"
"../sleek/loader/texture_loader.h"
77611,6 → 77611,7
"../sleek/gui/button.h"
"../sleek/gui/colorpicker.h"
"../sleek/gui/font.h"
"../sleek/gui/window.h"
 
1324743736 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/texture/fractal.h
"texture.h"
77876,7 → 77877,7
"font.h"
<ft2build.h>
 
1423337629 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/frame.cpp
1423622258 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/frame.cpp
"interface.h"
"frame.h"
 
77892,7 → 77893,7
"interface.h"
"statictext.h"
 
1423337804 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/theme.cpp
1423337986 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/theme.cpp
"interface.h"
"../driver/driver.h"
"theme.h"
77904,7 → 77905,7
"window.h"
"scrollbar.h"
 
1423337654 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/window.cpp
1423624146 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/window.cpp
"interface.h"
"window.h"
 
80974,7 → 80975,7
"../compile.h"
<string.h>
 
1423324939 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/interface.cpp
1423624039 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/interface.cpp
"interface.h"
"button.h"
"statictext.h"
81000,8 → 81001,9
"../library/glm/vec3.hpp"
"../define.h"
 
1423323505 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/math/pixel.h
1423621604 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/math/pixel.h
"../define.h"
"vector3d.h"
 
1421726113 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/reference.h
"math/aabbox.h"
81233,7 → 81235,7
"texture_array.h"
"texture3d.h"
 
1423323548 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/math/pixel.cpp
1423621871 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/math/pixel.cpp
"pixel.h"
"../math/function.h"
 
81716,7 → 81718,7
1423335390 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/math/function.h
<memory>
 
1423337915 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/colorpicker.cpp
1423621500 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/gui/colorpicker.cpp
"colorpicker.h"
"interface.h"
"scrollbar.h"
/SleekThink.layout
Cannot display: file marked as a binary type.
svn:mime-type = application/xml
/bin/SleekThink
Cannot display: file marked as a binary type.
svn:mime-type = application/x-executable
/bin/gmon.out
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/src/app/GameMenu.cpp
5,7 → 5,8
#include "../sleek/gui/frame.h"
#include "../sleek/gui/button.h"
#include "../sleek/gui/colorpicker.h"
#include "../sleek/gui/font.h"
#include "../sleek/gui/font.h"
#include "../sleek/gui/window.h"
 
using namespace sleek;
#define number 100
65,8 → 66,11
break;
case 11:
{
auto win = guienv->addWindow("", {0, 0, 110, 180});
auto color = std::make_shared<sleek::gui::colorpicker>(guienv);
guienv->addCustomFrame(color);
color->move({0, 20});
color->setParent(win.get());
guienv->addCustomFrame(win);
}
break;
case 12:
75,7 → 79,7
}
break;
case gui::IET_COLORPICKER_SELECTED:
guienv->removeFrame(a->gui.called->getptr());
guienv->removeFrame(a->gui.called->getParent()->getptr());
break;
}
return false;
/src/sleek/gui/colorpicker.cpp
3,6 → 3,7
#include "interface.h"
#include "scrollbar.h"
#include "button.h"
 
#include "../driver/texture.h"
#include "../math/vector3d.h"
#include "../math/function.h"
9,34 → 10,6
 
namespace sleek
{
inline math::vector3df RGBftoHSV(const math::pixel &rgb)
{
math::vector3df hsv;
 
f32 M = math::max(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
f32 m = math::min(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
f32 C = M - m;
 
if(C == 0)
hsv.x = 0;
else if(M <= rgb.getRed())
hsv.x =((rgb.getGreen() - rgb.getBlue()) / C);
else if(M <= rgb.getGreen())
hsv.x =((rgb.getBlue() - rgb.getRed()) / C) + 2;
else if(M <= rgb.getBlue())
hsv.x =((rgb.getRed() - rgb.getGreen()) / C) + 4;
 
hsv.x *= 60;
if(hsv.x < 0)
hsv.x += 360;
 
hsv.y = M;
 
if(hsv.y == 0) hsv.z = 0;
else hsv.z = C / hsv.y;
 
return hsv;
}
namespace gui
{
colorpicker::colorpicker(interface *guienv) noexcept
213,7 → 186,7
{
pickcolor = c;
 
math::vector3df hsv = RGBftoHSV(c);
math::vector3df hsv = c.HSV();
 
colorpos = 150-hsv.x/360.f*150.f;
pickpos.x = hsv.y*80.f;
/src/sleek/gui/interface.cpp
153,7 → 153,8
{
if(*it == i)
{
gui.push_back(std::shared_ptr<frame>(*it));
gui.push_back(i);
(*it).reset();
gui.erase(it);
break;
}
/src/sleek/gui/window.cpp
10,9 → 10,9
title_size = 20;
isHovored = isMoved = false;
 
close = new button(m);
close = std::make_shared<button>(m);
close->box = math::aabbox2di(math::vector2di(0,0),math::vector2di(10,10));
close->relative = math::vector2di(box.getSize().x-15, 5);
close->move({5, 5});
close->setParent(this);
close->UpdateAbsolutePosition();
close->setText("Close");
19,13 → 19,12
}
 
window::~window() noexcept
{
delete close;
{
}
 
button* window::getCloseButton() const noexcept
{
return close;
return close.get();
}
 
void window::UpdateFontPos() noexcept
63,9 → 62,10
return true;
}
 
if(e->type == device::EVENT_MOUSSE_DOWN && e->mouse[device::MOUSE_LEFT] && box.intersect(e->mouse_pos))
if(e->type == device::EVENT_MOUSSE_DOWN && e->mouse[device::MOUSE_LEFT] && box.intersect(e->mouse_pos))
{
mom->unActiveElement();
mom->popFrame(getptr());
isActive = true;
}
 
83,9 → 83,6
if(e->type == device::EVENT_MOUSSE_DOWN && e->mouse[device::MOUSE_LEFT] && til.intersect(e->mouse_pos))
isMoved = true;
 
if(e->type == device::EVENT_MOUSSE_DOWN && e->mouse[device::MOUSE_LEFT] && box.intersect(e->mouse_pos))
mom->popFrame(getptr());
 
if(e->type == device::EVENT_MOUSSE_UP)
isMoved = false;
 
109,6 → 106,7
if(isMoved)
{
e->gui.called = this;
e->gui.type = gui::IGT_WINDOW;
e->gui.code = gui::IET_WINDOW_MOVED;
return true;
}
116,6 → 114,7
if(CHovored != isHovored)
{
e->gui.called = this;
e->gui.type = gui::IGT_WINDOW;
e->gui.code = isHovored ?
gui::IET_WINDOW_HOVORED :
gui::IET_WINDOW_FOCUSED;
/src/sleek/gui/window.h
22,7 → 22,7
virtual bool manage(device::input*) noexcept;
virtual void render() noexcept;
protected:
button *close;
std::shared_ptr<button> close;
void UpdateFontPos() noexcept;
private:
math::vector2di def;
/src/sleek/math/pixel.cpp
107,5 → 107,34
u8 luminaissance = getLuminaissance();
return pixel(luminaissance,luminaissance,luminaissance,alpha);
}
 
/* ***************************************** */
 
vector3df pixel::HSV() const noexcept
{
math::vector3df hsv;
 
f32 M = math::max(getRed(), getGreen(), getBlue());
f32 m = math::min(getRed(), getGreen(), getBlue());
f32 C = M - m;
 
if(C == 0)
hsv.x = 0;
else if(M <= getRed())
hsv.x = (getGreen() - getBlue()) / C;
else if(M <= getGreen())
hsv.x = (getBlue() - getRed()) / C + 2;
else if(M <= getBlue())
hsv.x = (getRed() - getGreen()) / C + 4;
 
hsv.x *= 60;
if(hsv.x < 0)
hsv.x += 360;
 
hsv.y = M;
hsv.z = M == 0 ? 0 : C / hsv.y;
 
return hsv;
}
}
}
/src/sleek/math/pixel.h
2,6 → 2,7
#define PIXEL
 
#include "../define.h"
#include "vector3d.h"
 
namespace sleek
{
12,26 → 13,28
public:
pixel(const u32 = 0xFFFFFFFF) noexcept;
pixel(const u8 r, const u8 g, const u8 b,const u8 a = 255) noexcept;
virtual ~pixel() noexcept;
~pixel() noexcept;
 
virtual void set(const u8 r, const u8 g, const u8 b,const u8 a = 255) noexcept;
void set(const u8 r, const u8 g, const u8 b,const u8 a = 255) noexcept;
 
virtual void setRed(const u8) noexcept;
virtual void setGreen(const u8) noexcept;
virtual void setBlue(const u8) noexcept;
virtual void setAlpha(const u8) noexcept;
void setRed(const u8) noexcept;
void setGreen(const u8) noexcept;
void setBlue(const u8) noexcept;
void setAlpha(const u8) noexcept;
 
virtual u8 getRed() const noexcept;
virtual u8 getGreen() const noexcept;
virtual u8 getBlue() const noexcept;
virtual u8 getAlpha() const noexcept;
u8 getRed() const noexcept;
u8 getGreen() const noexcept;
u8 getBlue() const noexcept;
u8 getAlpha() const noexcept;
 
virtual pixel getInterpolated(const pixel &other, f32 d) const;
pixel getInterpolated(const pixel &other, f32 d) const;
 
virtual pixel monochrome() const noexcept;
virtual pixel monochrome_with_alpha() const noexcept;
virtual u8 getLuminaissance() const noexcept;
pixel monochrome() const noexcept;
pixel monochrome_with_alpha() const noexcept;
u8 getLuminaissance() const noexcept;
public:
vector3df HSV() const noexcept;
public:
u8 red;
u8 green;
u8 blue;