C++ code cleanup
This commit is contained in:
parent
f8664fce71
commit
0faaef76e8
@ -1255,8 +1255,7 @@ sub Destroy {
|
|||||||
# my ($self, $dc) = @_;
|
# my ($self, $dc) = @_;
|
||||||
#
|
#
|
||||||
# # prevent calling SetCurrent() when window is not shown yet
|
# # prevent calling SetCurrent() when window is not shown yet
|
||||||
# return unless Slic3r::GUI::_3DScene::is_shown_on_screen($self);
|
# return unless $self->IsShownOnScreen;
|
||||||
## return unless $self->IsShownOnScreen;
|
|
||||||
# return unless my $context = $self->GetContext;
|
# return unless my $context = $self->GetContext;
|
||||||
# $self->SetCurrent($context);
|
# $self->SetCurrent($context);
|
||||||
# $self->InitGL;
|
# $self->InitGL;
|
||||||
|
@ -222,7 +222,6 @@ BoundingBox3Base<PointClass>::center() const
|
|||||||
}
|
}
|
||||||
template Pointf3 BoundingBox3Base<Pointf3>::center() const;
|
template Pointf3 BoundingBox3Base<Pointf3>::center() const;
|
||||||
|
|
||||||
//######################################################################################################################################33
|
|
||||||
template <class PointClass> coordf_t
|
template <class PointClass> coordf_t
|
||||||
BoundingBox3Base<PointClass>::max_size() const
|
BoundingBox3Base<PointClass>::max_size() const
|
||||||
{
|
{
|
||||||
@ -230,7 +229,6 @@ BoundingBox3Base<PointClass>::max_size() const
|
|||||||
return std::max(s.x, std::max(s.y, s.z));
|
return std::max(s.x, std::max(s.y, s.z));
|
||||||
}
|
}
|
||||||
template coordf_t BoundingBox3Base<Pointf3>::max_size() const;
|
template coordf_t BoundingBox3Base<Pointf3>::max_size() const;
|
||||||
//######################################################################################################################################33
|
|
||||||
|
|
||||||
// Align a coordinate to a grid. The coordinate may be negative,
|
// Align a coordinate to a grid. The coordinate may be negative,
|
||||||
// the aligned value will never be bigger than the original one.
|
// the aligned value will never be bigger than the original one.
|
||||||
|
@ -94,9 +94,7 @@ public:
|
|||||||
void translate(const Pointf3 &pos) { this->translate(pos.x, pos.y, pos.z); }
|
void translate(const Pointf3 &pos) { this->translate(pos.x, pos.y, pos.z); }
|
||||||
void offset(coordf_t delta);
|
void offset(coordf_t delta);
|
||||||
PointClass center() const;
|
PointClass center() const;
|
||||||
//######################################################################################################################################33
|
|
||||||
coordf_t max_size() const;
|
coordf_t max_size() const;
|
||||||
//######################################################################################################################################33
|
|
||||||
|
|
||||||
bool contains(const PointClass &point) const {
|
bool contains(const PointClass &point) const {
|
||||||
return BoundingBoxBase<PointClass>::contains(point) && point.z >= this->min.z && point.z <= this->max.z;
|
return BoundingBoxBase<PointClass>::contains(point) && point.z >= this->min.z && point.z <= this->max.z;
|
||||||
|
@ -184,9 +184,7 @@ public:
|
|||||||
|
|
||||||
void reset_layer_height_profile();
|
void reset_layer_height_profile();
|
||||||
|
|
||||||
//############################################################################################################################################
|
|
||||||
void adjust_layer_height_profile(coordf_t z, coordf_t layer_thickness_delta, coordf_t band_width, int action);
|
void adjust_layer_height_profile(coordf_t z, coordf_t layer_thickness_delta, coordf_t band_width, int action);
|
||||||
//############################################################################################################################################
|
|
||||||
|
|
||||||
// Collect the slicing parameters, to be used by variable layer thickness algorithm,
|
// Collect the slicing parameters, to be used by variable layer thickness algorithm,
|
||||||
// by the interactive layer height editor and by the printing process itself.
|
// by the interactive layer height editor and by the printing process itself.
|
||||||
|
@ -4,9 +4,7 @@
|
|||||||
#include "Geometry.hpp"
|
#include "Geometry.hpp"
|
||||||
#include "SupportMaterial.hpp"
|
#include "SupportMaterial.hpp"
|
||||||
#include "Surface.hpp"
|
#include "Surface.hpp"
|
||||||
//############################################################################################################################################
|
|
||||||
#include "Slicing.hpp"
|
#include "Slicing.hpp"
|
||||||
//############################################################################################################################################
|
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <boost/log/trivial.hpp>
|
#include <boost/log/trivial.hpp>
|
||||||
@ -1964,7 +1962,6 @@ void PrintObject::reset_layer_height_profile()
|
|||||||
this->model_object()->layer_height_profile_valid = false;
|
this->model_object()->layer_height_profile_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//############################################################################################################################################
|
|
||||||
void PrintObject::adjust_layer_height_profile(coordf_t z, coordf_t layer_thickness_delta, coordf_t band_width, int action)
|
void PrintObject::adjust_layer_height_profile(coordf_t z, coordf_t layer_thickness_delta, coordf_t band_width, int action)
|
||||||
{
|
{
|
||||||
update_layer_height_profile(_model_object->layer_height_profile);
|
update_layer_height_profile(_model_object->layer_height_profile);
|
||||||
@ -1972,6 +1969,5 @@ void PrintObject::adjust_layer_height_profile(coordf_t z, coordf_t layer_thickne
|
|||||||
_model_object->layer_height_profile_valid = true;
|
_model_object->layer_height_profile_valid = true;
|
||||||
layer_height_profile_valid = false;
|
layer_height_profile_valid = false;
|
||||||
}
|
}
|
||||||
//############################################################################################################################################
|
|
||||||
|
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
@ -91,18 +91,12 @@ public:
|
|||||||
~PerlCallback() { this->deregister_callback(); }
|
~PerlCallback() { this->deregister_callback(); }
|
||||||
void register_callback(void *sv);
|
void register_callback(void *sv);
|
||||||
void deregister_callback();
|
void deregister_callback();
|
||||||
//##############################################################################################################
|
|
||||||
void call() const;
|
void call() const;
|
||||||
void call(int i) const;
|
void call(int i) const;
|
||||||
void call(int i, int j) const;
|
void call(int i, int j) const;
|
||||||
void call(const std::vector<int>& ints) const;
|
void call(const std::vector<int>& ints) const;
|
||||||
void call(double x, double y) const;
|
void call(double x, double y) const;
|
||||||
void call(bool b) const;
|
void call(bool b) const;
|
||||||
// void call();
|
|
||||||
// void call(int i);
|
|
||||||
// void call(int i, int j);
|
|
||||||
//// void call(const std::vector<int> &ints);
|
|
||||||
//##############################################################################################################
|
|
||||||
private:
|
private:
|
||||||
void *m_callback;
|
void *m_callback;
|
||||||
};
|
};
|
||||||
|
@ -184,10 +184,7 @@ void PerlCallback::deregister_callback()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//##############################################################################################################
|
|
||||||
void PerlCallback::call() const
|
void PerlCallback::call() const
|
||||||
//void PerlCallback::call()
|
|
||||||
//##############################################################################################################
|
|
||||||
{
|
{
|
||||||
if (! m_callback)
|
if (! m_callback)
|
||||||
return;
|
return;
|
||||||
@ -201,10 +198,7 @@ void PerlCallback::call() const
|
|||||||
LEAVE;
|
LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//##############################################################################################################
|
|
||||||
void PerlCallback::call(int i) const
|
void PerlCallback::call(int i) const
|
||||||
//void PerlCallback::call(int i)
|
|
||||||
//##############################################################################################################
|
|
||||||
{
|
{
|
||||||
if (! m_callback)
|
if (! m_callback)
|
||||||
return;
|
return;
|
||||||
@ -219,10 +213,7 @@ void PerlCallback::call(int i) const
|
|||||||
LEAVE;
|
LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//##############################################################################################################
|
|
||||||
void PerlCallback::call(int i, int j) const
|
void PerlCallback::call(int i, int j) const
|
||||||
//void PerlCallback::call(int i, int j)
|
|
||||||
//##############################################################################################################
|
|
||||||
{
|
{
|
||||||
if (! m_callback)
|
if (! m_callback)
|
||||||
return;
|
return;
|
||||||
@ -238,10 +229,7 @@ void PerlCallback::call(int i, int j) const
|
|||||||
LEAVE;
|
LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//##############################################################################################################
|
|
||||||
void PerlCallback::call(const std::vector<int>& ints) const
|
void PerlCallback::call(const std::vector<int>& ints) const
|
||||||
//void PerlCallback::call(const std::vector<int> &ints)
|
|
||||||
//##############################################################################################################
|
|
||||||
{
|
{
|
||||||
if (! m_callback)
|
if (! m_callback)
|
||||||
return;
|
return;
|
||||||
@ -249,24 +237,16 @@ void PerlCallback::call(const std::vector<int>& ints) const
|
|||||||
ENTER;
|
ENTER;
|
||||||
SAVETMPS;
|
SAVETMPS;
|
||||||
PUSHMARK(SP);
|
PUSHMARK(SP);
|
||||||
//##############################################################################################################
|
|
||||||
for (int i : ints)
|
for (int i : ints)
|
||||||
{
|
{
|
||||||
XPUSHs(sv_2mortal(newSViv(i)));
|
XPUSHs(sv_2mortal(newSViv(i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// AV* av = newAV();
|
|
||||||
// for (int i : ints)
|
|
||||||
// av_push(av, newSViv(i));
|
|
||||||
// XPUSHs(av);
|
|
||||||
//##############################################################################################################
|
|
||||||
PUTBACK;
|
PUTBACK;
|
||||||
perl_call_sv(SvRV((SV*)m_callback), G_DISCARD);
|
perl_call_sv(SvRV((SV*)m_callback), G_DISCARD);
|
||||||
FREETMPS;
|
FREETMPS;
|
||||||
LEAVE;
|
LEAVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//##############################################################################################################
|
|
||||||
void PerlCallback::call(double x, double y) const
|
void PerlCallback::call(double x, double y) const
|
||||||
{
|
{
|
||||||
if (!m_callback)
|
if (!m_callback)
|
||||||
@ -287,7 +267,6 @@ void PerlCallback::call(bool b) const
|
|||||||
{
|
{
|
||||||
call(b ? 1 : 0);
|
call(b ? 1 : 0);
|
||||||
}
|
}
|
||||||
//##############################################################################################################
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#ifndef NOMINMAX
|
#ifndef NOMINMAX
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,14 +6,10 @@
|
|||||||
#include "../../libslic3r/Line.hpp"
|
#include "../../libslic3r/Line.hpp"
|
||||||
#include "../../libslic3r/TriangleMesh.hpp"
|
#include "../../libslic3r/TriangleMesh.hpp"
|
||||||
#include "../../libslic3r/Utils.hpp"
|
#include "../../libslic3r/Utils.hpp"
|
||||||
//##################################################################################################################
|
|
||||||
#include "../../slic3r/GUI/GLCanvas3DManager.hpp"
|
#include "../../slic3r/GUI/GLCanvas3DManager.hpp"
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
class wxBitmap;
|
class wxBitmap;
|
||||||
//##################################################################################################################
|
|
||||||
class wxWindow;
|
class wxWindow;
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
@ -23,13 +19,11 @@ class Model;
|
|||||||
class ModelObject;
|
class ModelObject;
|
||||||
class GCodePreviewData;
|
class GCodePreviewData;
|
||||||
class DynamicPrintConfig;
|
class DynamicPrintConfig;
|
||||||
//##################################################################################################################
|
|
||||||
class ExtrusionPath;
|
class ExtrusionPath;
|
||||||
class ExtrusionMultiPath;
|
class ExtrusionMultiPath;
|
||||||
class ExtrusionLoop;
|
class ExtrusionLoop;
|
||||||
class ExtrusionEntity;
|
class ExtrusionEntity;
|
||||||
class ExtrusionEntityCollection;
|
class ExtrusionEntityCollection;
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
// A container for interleaved arrays of 3D vertices and normals,
|
// A container for interleaved arrays of 3D vertices and normals,
|
||||||
// possibly indexed by triangles and / or quads.
|
// possibly indexed by triangles and / or quads.
|
||||||
@ -450,37 +444,6 @@ private:
|
|||||||
|
|
||||||
class _3DScene
|
class _3DScene
|
||||||
{
|
{
|
||||||
//##################################################################################################################
|
|
||||||
// struct GCodePreviewVolumeIndex
|
|
||||||
// {
|
|
||||||
// enum EType
|
|
||||||
// {
|
|
||||||
// Extrusion,
|
|
||||||
// Travel,
|
|
||||||
// Retraction,
|
|
||||||
// Unretraction,
|
|
||||||
// Shell,
|
|
||||||
// Num_Geometry_Types
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// struct FirstVolume
|
|
||||||
// {
|
|
||||||
// EType type;
|
|
||||||
// unsigned int flag;
|
|
||||||
// // Index of the first volume in a GLVolumeCollection.
|
|
||||||
// unsigned int id;
|
|
||||||
//
|
|
||||||
// FirstVolume(EType type, unsigned int flag, unsigned int id) : type(type), flag(flag), id(id) {}
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// std::vector<FirstVolume> first_volumes;
|
|
||||||
//
|
|
||||||
// void reset() { first_volumes.clear(); }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// static GCodePreviewVolumeIndex s_gcode_preview_volume_index;
|
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
class TextureBase
|
class TextureBase
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
@ -540,12 +503,9 @@ class _3DScene
|
|||||||
|
|
||||||
static LegendTexture s_legend_texture;
|
static LegendTexture s_legend_texture;
|
||||||
static WarningTexture s_warning_texture;
|
static WarningTexture s_warning_texture;
|
||||||
//##################################################################################################################
|
|
||||||
static GUI::GLCanvas3DManager s_canvas_mgr;
|
static GUI::GLCanvas3DManager s_canvas_mgr;
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//##################################################################################################################
|
|
||||||
static void init_gl();
|
static void init_gl();
|
||||||
static std::string get_gl_info(bool format_as_html, bool extensions);
|
static std::string get_gl_info(bool format_as_html, bool extensions);
|
||||||
static bool use_VBOs();
|
static bool use_VBOs();
|
||||||
@ -629,10 +589,6 @@ public:
|
|||||||
static void register_on_wipe_tower_moved_callback(wxGLCanvas* canvas, void* callback);
|
static void register_on_wipe_tower_moved_callback(wxGLCanvas* canvas, void* callback);
|
||||||
static void register_on_enable_action_buttons_callback(wxGLCanvas* canvas, void* callback);
|
static void register_on_enable_action_buttons_callback(wxGLCanvas* canvas, void* callback);
|
||||||
|
|
||||||
// static void _glew_init();
|
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
//##################################################################################################################
|
|
||||||
static std::vector<int> load_object(wxGLCanvas* canvas, const ModelObject* model_object, int obj_idx, std::vector<int> instance_idxs);
|
static std::vector<int> load_object(wxGLCanvas* canvas, const ModelObject* model_object, int obj_idx, std::vector<int> instance_idxs);
|
||||||
static std::vector<int> load_object(wxGLCanvas* canvas, const Model* model, int obj_idx);
|
static std::vector<int> load_object(wxGLCanvas* canvas, const Model* model, int obj_idx);
|
||||||
|
|
||||||
@ -642,13 +598,9 @@ public:
|
|||||||
static void load_print_object_toolpaths(wxGLCanvas* canvas, const PrintObject* print_object, const std::vector<std::string>& str_tool_colors);
|
static void load_print_object_toolpaths(wxGLCanvas* canvas, const PrintObject* print_object, const std::vector<std::string>& str_tool_colors);
|
||||||
static void load_wipe_tower_toolpaths(wxGLCanvas* canvas, const std::vector<std::string>& str_tool_colors);
|
static void load_wipe_tower_toolpaths(wxGLCanvas* canvas, const std::vector<std::string>& str_tool_colors);
|
||||||
static void load_gcode_preview(wxGLCanvas* canvas, const GCodePreviewData* preview_data, const std::vector<std::string>& str_tool_colors);
|
static void load_gcode_preview(wxGLCanvas* canvas, const GCodePreviewData* preview_data, const std::vector<std::string>& str_tool_colors);
|
||||||
// static void load_gcode_preview(const Print* print, const GCodePreviewData* preview_data, GLVolumeCollection* volumes, const std::vector<std::string>& str_tool_colors, bool use_VBOs);
|
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
//##################################################################################################################
|
|
||||||
// generates the legend texture in dependence of the current shown view type
|
// generates the legend texture in dependence of the current shown view type
|
||||||
static void generate_legend_texture(const GCodePreviewData& preview_data, const std::vector<float>& tool_colors);
|
static void generate_legend_texture(const GCodePreviewData& preview_data, const std::vector<float>& tool_colors);
|
||||||
//##################################################################################################################
|
|
||||||
static unsigned int get_legend_texture_width();
|
static unsigned int get_legend_texture_width();
|
||||||
static unsigned int get_legend_texture_height();
|
static unsigned int get_legend_texture_height();
|
||||||
|
|
||||||
@ -663,27 +615,6 @@ public:
|
|||||||
static void reset_warning_texture();
|
static void reset_warning_texture();
|
||||||
static unsigned int finalize_warning_texture();
|
static unsigned int finalize_warning_texture();
|
||||||
|
|
||||||
//##################################################################################################################
|
|
||||||
// static void _load_print_toolpaths(
|
|
||||||
// const Print *print,
|
|
||||||
// GLVolumeCollection *volumes,
|
|
||||||
// const std::vector<std::string> &tool_colors,
|
|
||||||
// bool use_VBOs);
|
|
||||||
//
|
|
||||||
// static void _load_print_object_toolpaths(
|
|
||||||
// const PrintObject *print_object,
|
|
||||||
// GLVolumeCollection *volumes,
|
|
||||||
// const std::vector<std::string> &tool_colors,
|
|
||||||
// bool use_VBOs);
|
|
||||||
//
|
|
||||||
// static void _load_wipe_tower_toolpaths(
|
|
||||||
// const Print *print,
|
|
||||||
// GLVolumeCollection *volumes,
|
|
||||||
// const std::vector<std::string> &tool_colors_str,
|
|
||||||
// bool use_VBOs);
|
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
//##################################################################################################################
|
|
||||||
static void thick_lines_to_verts(const Lines& lines, const std::vector<double>& widths, const std::vector<double>& heights, bool closed, double top_z, GLVolume& volume);
|
static void thick_lines_to_verts(const Lines& lines, const std::vector<double>& widths, const std::vector<double>& heights, bool closed, double top_z, GLVolume& volume);
|
||||||
static void thick_lines_to_verts(const Lines3& lines, const std::vector<double>& widths, const std::vector<double>& heights, bool closed, GLVolume& volume);
|
static void thick_lines_to_verts(const Lines3& lines, const std::vector<double>& widths, const std::vector<double>& heights, bool closed, GLVolume& volume);
|
||||||
static void extrusionentity_to_verts(const ExtrusionPath& extrusion_path, float print_z, GLVolume& volume);
|
static void extrusionentity_to_verts(const ExtrusionPath& extrusion_path, float print_z, GLVolume& volume);
|
||||||
@ -694,28 +625,6 @@ public:
|
|||||||
static void extrusionentity_to_verts(const ExtrusionEntity* extrusion_entity, float print_z, const Point& copy, GLVolume& volume);
|
static void extrusionentity_to_verts(const ExtrusionEntity* extrusion_entity, float print_z, const Point& copy, GLVolume& volume);
|
||||||
static void polyline3_to_verts(const Polyline3& polyline, double width, double height, GLVolume& volume);
|
static void polyline3_to_verts(const Polyline3& polyline, double width, double height, GLVolume& volume);
|
||||||
static void point3_to_verts(const Point3& point, double width, double height, GLVolume& volume);
|
static void point3_to_verts(const Point3& point, double width, double height, GLVolume& volume);
|
||||||
//##################################################################################################################
|
|
||||||
|
|
||||||
private:
|
|
||||||
//##################################################################################################################
|
|
||||||
// // generates gcode extrusion paths geometry
|
|
||||||
// static void _load_gcode_extrusion_paths(const GCodePreviewData& preview_data, GLVolumeCollection& volumes, const std::vector<float>& tool_colors, bool use_VBOs);
|
|
||||||
// // generates gcode travel paths geometry
|
|
||||||
// static void _load_gcode_travel_paths(const GCodePreviewData& preview_data, GLVolumeCollection& volumes, const std::vector<float>& tool_colors, bool use_VBOs);
|
|
||||||
// static bool _travel_paths_by_type(const GCodePreviewData& preview_data, GLVolumeCollection& volumes);
|
|
||||||
// static bool _travel_paths_by_feedrate(const GCodePreviewData& preview_data, GLVolumeCollection& volumes);
|
|
||||||
// static bool _travel_paths_by_tool(const GCodePreviewData& preview_data, GLVolumeCollection& volumes, const std::vector<float>& tool_colors);
|
|
||||||
// // generates gcode retractions geometry
|
|
||||||
// static void _load_gcode_retractions(const GCodePreviewData& preview_data, GLVolumeCollection& volumes, bool use_VBOs);
|
|
||||||
// // generates gcode unretractions geometry
|
|
||||||
// static void _load_gcode_unretractions(const GCodePreviewData& preview_data, GLVolumeCollection& volumes, bool use_VBOs);
|
|
||||||
// // sets gcode geometry visibility according to user selection
|
|
||||||
// static void _update_gcode_volumes_visibility(const GCodePreviewData& preview_data, GLVolumeCollection& volumes);
|
|
||||||
// // generates the legend texture in dependence of the current shown view type
|
|
||||||
// static void _generate_legend_texture(const GCodePreviewData& preview_data, const std::vector<float>& tool_colors);
|
|
||||||
// // generates objects and wipe tower geometry
|
|
||||||
// static void _load_shells(const Print& print, GLVolumeCollection& volumes, bool use_VBOs);
|
|
||||||
//##################################################################################################################
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
#include "GLShader.hpp"
|
#include "GLShader.hpp"
|
||||||
|
|
||||||
//############################################################################################################################################
|
|
||||||
#include "../../libslic3r/Utils.hpp"
|
#include "../../libslic3r/Utils.hpp"
|
||||||
#include <boost/nowide/fstream.hpp>
|
#include <boost/nowide/fstream.hpp>
|
||||||
//############################################################################################################################################
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@ -27,10 +25,7 @@ inline std::string gl_get_string_safe(GLenum param)
|
|||||||
return std::string(value ? value : "N/A");
|
return std::string(value ? value : "N/A");
|
||||||
}
|
}
|
||||||
|
|
||||||
//############################################################################################################################################
|
|
||||||
bool GLShader::load_from_text(const char *fragment_shader, const char *vertex_shader)
|
bool GLShader::load_from_text(const char *fragment_shader, const char *vertex_shader)
|
||||||
//bool GLShader::load(const char *fragment_shader, const char *vertex_shader)
|
|
||||||
//############################################################################################################################################
|
|
||||||
{
|
{
|
||||||
std::string gl_version = gl_get_string_safe(GL_VERSION);
|
std::string gl_version = gl_get_string_safe(GL_VERSION);
|
||||||
int major = atoi(gl_version.c_str());
|
int major = atoi(gl_version.c_str());
|
||||||
@ -131,7 +126,6 @@ bool GLShader::load_from_text(const char *fragment_shader, const char *vertex_sh
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//############################################################################################################################################
|
|
||||||
bool GLShader::load_from_file(const char* fragment_shader_filename, const char* vertex_shader_filename)
|
bool GLShader::load_from_file(const char* fragment_shader_filename, const char* vertex_shader_filename)
|
||||||
{
|
{
|
||||||
const std::string& path = resources_dir() + "/shaders/";
|
const std::string& path = resources_dir() + "/shaders/";
|
||||||
@ -166,7 +160,6 @@ bool GLShader::load_from_file(const char* fragment_shader_filename, const char*
|
|||||||
|
|
||||||
return load_from_text(fragment_shader.c_str(), vertex_shader.c_str());
|
return load_from_text(fragment_shader.c_str(), vertex_shader.c_str());
|
||||||
}
|
}
|
||||||
//############################################################################################################################################
|
|
||||||
|
|
||||||
void GLShader::release()
|
void GLShader::release()
|
||||||
{
|
{
|
||||||
|
@ -16,11 +16,9 @@ public:
|
|||||||
{}
|
{}
|
||||||
~GLShader();
|
~GLShader();
|
||||||
|
|
||||||
//############################################################################################################################################
|
|
||||||
bool load_from_text(const char *fragment_shader, const char *vertex_shader);
|
bool load_from_text(const char *fragment_shader, const char *vertex_shader);
|
||||||
bool load_from_file(const char* fragment_shader_filename, const char* vertex_shader_filename);
|
bool load_from_file(const char* fragment_shader_filename, const char* vertex_shader_filename);
|
||||||
// bool load(const char *fragment_shader, const char *vertex_shader);
|
|
||||||
//############################################################################################################################################
|
|
||||||
void release();
|
void release();
|
||||||
|
|
||||||
int get_attrib_location(const char *name) const;
|
int get_attrib_location(const char *name) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user