Merge pull request #74 from sonoro1234/ImVector_templates

add ImVector template types
This commit is contained in:
Victor Bombi
2018-10-18 13:07:28 +02:00
committed by GitHub
4 changed files with 168 additions and 89 deletions

View File

@@ -40,12 +40,30 @@ typedef struct ImColor_Simple { ImVec4_Simple Value;} ImColor_Simple;
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
struct ImDrawChannel;
typedef struct CustomRect CustomRect;
typedef struct GlyphRangesBuilder GlyphRangesBuilder;
typedef struct ImFontGlyph ImFontGlyph;
typedef unsigned short ImDrawIdx;;
typedef struct Pair Pair;
typedef struct TextRange TextRange;
typedef struct ImVector_ImVec2 ImVector_ImVec2;
typedef struct ImVector_ImDrawIdx ImVector_ImDrawIdx;
typedef struct ImVector_ImVec4 ImVector_ImVec4;
typedef struct ImVector_TextRange ImVector_TextRange;
typedef struct ImVector_ImFontPtr ImVector_ImFontPtr;
typedef struct ImVector_ImDrawCmd ImVector_ImDrawCmd;
typedef struct ImVector_ImDrawVert ImVector_ImDrawVert;
typedef struct ImVector_unsigned_short ImVector_unsigned_short;
typedef struct ImVector_ImTextureID ImVector_ImTextureID;
typedef struct ImVector_char ImVector_char;
typedef struct ImVector_ImDrawChannel ImVector_ImDrawChannel;
typedef struct ImVector_CustomRect ImVector_CustomRect;
typedef struct ImVector_Pair ImVector_Pair;
typedef struct ImVector_unsigned_char ImVector_unsigned_char;
typedef struct ImVector_ImFontGlyph ImVector_ImFontGlyph;
typedef struct ImVector_ImFontConfig ImVector_ImFontConfig;
typedef struct ImVector_ImWchar ImVector_ImWchar;
typedef struct ImVector_float ImVector_float;
typedef struct ImVec4 ImVec4;
typedef struct ImVec2 ImVec2;
typedef struct ImGuiTextBuffer ImGuiTextBuffer;
@@ -69,6 +87,7 @@ typedef struct ImDrawList ImDrawList;
typedef struct ImDrawData ImDrawData;
typedef struct ImDrawCmd ImDrawCmd;
typedef struct ImDrawChannel ImDrawChannel;
struct ImDrawChannel;
struct ImDrawCmd;
struct ImDrawData;
struct ImDrawList;
@@ -568,13 +587,25 @@ struct ImGuiIO
float NavInputsDownDuration[ImGuiNavInput_COUNT];
float NavInputsDownDurationPrev[ImGuiNavInput_COUNT];
};
struct ImVector
{
int Size;
int Capacity;
void* Data;
};
typedef struct ImVector ImVector;
typedef struct ImVector{int Size;int Capacity;void* Data;} ImVector;
struct ImVector_float {int Size;int Capacity;float* Data;} ImVector_float;
struct ImVector_ImWchar {int Size;int Capacity;ImWchar* Data;} ImVector_ImWchar;
struct ImVector_ImFontConfig {int Size;int Capacity;ImFontConfig* Data;} ImVector_ImFontConfig;
struct ImVector_ImFontGlyph {int Size;int Capacity;ImFontGlyph* Data;} ImVector_ImFontGlyph;
struct ImVector_unsigned_char {int Size;int Capacity;unsigned char* Data;} ImVector_unsigned_char;
struct ImVector_Pair {int Size;int Capacity;Pair* Data;} ImVector_Pair;
struct ImVector_CustomRect {int Size;int Capacity;CustomRect* Data;} ImVector_CustomRect;
struct ImVector_ImDrawChannel {int Size;int Capacity;ImDrawChannel* Data;} ImVector_ImDrawChannel;
struct ImVector_char {int Size;int Capacity;char* Data;} ImVector_char;
struct ImVector_ImTextureID {int Size;int Capacity;ImTextureID* Data;} ImVector_ImTextureID;
struct ImVector_unsigned_short {int Size;int Capacity;unsigned short* Data;} ImVector_unsigned_short;
struct ImVector_ImDrawVert {int Size;int Capacity;ImDrawVert* Data;} ImVector_ImDrawVert;
struct ImVector_ImDrawCmd {int Size;int Capacity;ImDrawCmd* Data;} ImVector_ImDrawCmd;
struct ImVector_ImFontPtr {int Size;int Capacity;ImFont** Data;} ImVector_ImFontPtr;
struct ImVector_TextRange {int Size;int Capacity;TextRange* Data;} ImVector_TextRange;
struct ImVector_ImVec4 {int Size;int Capacity;ImVec4* Data;} ImVector_ImVec4;
struct ImVector_ImDrawIdx {int Size;int Capacity;ImDrawIdx* Data;} ImVector_ImDrawIdx;
struct ImVector_ImVec2 {int Size;int Capacity;ImVec2* Data;} ImVector_ImVec2;
struct ImNewDummy {};
struct ImGuiOnceUponAFrame
{
@@ -583,16 +614,16 @@ struct ImGuiOnceUponAFrame
struct ImGuiTextFilter
{
char InputBuf[256];
ImVector/*<TextRange>*/ Filters;
ImVector_TextRange Filters;
int CountGrep;
};
struct ImGuiTextBuffer
{
ImVector/*<char>*/ Buf;
ImVector_char Buf;
};
struct ImGuiStorage
{
ImVector/*<Pair>*/ Data;
ImVector_Pair Data;
};
struct ImGuiInputTextCallbackData
{
@@ -646,7 +677,6 @@ struct ImDrawCmd
ImDrawCallback UserCallback;
void* UserCallbackData;
};
typedef unsigned short ImDrawIdx;
struct ImDrawVert
{
ImVec2 pos;
@@ -655,8 +685,8 @@ struct ImDrawVert
};
struct ImDrawChannel
{
ImVector/*<ImDrawCmd>*/ CmdBuffer;
ImVector/*<ImDrawIdx>*/ IdxBuffer;
ImVector_ImDrawCmd CmdBuffer;
ImVector_ImDrawIdx IdxBuffer;
};
enum ImDrawCornerFlags_
{
@@ -677,21 +707,21 @@ enum ImDrawListFlags_
};
struct ImDrawList
{
ImVector/*<ImDrawCmd>*/ CmdBuffer;
ImVector/*<ImDrawIdx>*/ IdxBuffer;
ImVector/*<ImDrawVert>*/ VtxBuffer;
ImVector_ImDrawCmd CmdBuffer;
ImVector_ImDrawIdx IdxBuffer;
ImVector_ImDrawVert VtxBuffer;
ImDrawListFlags Flags;
const ImDrawListSharedData* _Data;
const char* _OwnerName;
unsigned int _VtxCurrentIdx;
ImDrawVert* _VtxWritePtr;
ImDrawIdx* _IdxWritePtr;
ImVector/*<ImVec4>*/ _ClipRectStack;
ImVector/*<ImTextureID>*/ _TextureIdStack;
ImVector/*<ImVec2>*/ _Path;
ImVector_ImVec4 _ClipRectStack;
ImVector_ImTextureID _TextureIdStack;
ImVector_ImVec2 _Path;
int _ChannelsCurrent;
int _ChannelsCount;
ImVector/*<ImDrawChannel>*/ _Channels;
ImVector_ImDrawChannel _Channels;
};
struct ImDrawData
{
@@ -750,9 +780,9 @@ struct ImFontAtlas
int TexHeight;
ImVec2 TexUvScale;
ImVec2 TexUvWhitePixel;
ImVector/*<ImFont*>*/ Fonts;
ImVector/*<CustomRect>*/ CustomRects;
ImVector/*<ImFontConfig>*/ ConfigData;
ImVector_ImFontPtr Fonts;
ImVector_CustomRect CustomRects;
ImVector_ImFontConfig ConfigData;
int CustomRectIds[1];
};
struct ImFont
@@ -760,9 +790,9 @@ struct ImFont
float FontSize;
float Scale;
ImVec2 DisplayOffset;
ImVector/*<ImFontGlyph>*/ Glyphs;
ImVector/*<float>*/ IndexAdvanceX;
ImVector/*<unsigned short>*/ IndexLookup;
ImVector_ImFontGlyph Glyphs;
ImVector_float IndexAdvanceX;
ImVector_unsigned_short IndexLookup;
const ImFontGlyph* FallbackGlyph;
float FallbackAdvanceX;
ImWchar FallbackChar;
@@ -775,7 +805,7 @@ struct ImFont
};
struct GlyphRangesBuilder
{
ImVector/*<unsigned char>*/ UsedChars;
ImVector_unsigned_char UsedChars;
};
struct CustomRect
{
@@ -832,9 +862,6 @@ typedef ImGuiTextFilter::TextRange TextRange;
typedef ImGuiStorage::Pair Pair;
typedef ImVector<TextRange> ImVector_TextRange;
typedef ImVector<ImWchar> ImVector_ImWchar;
#else //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
typedef ImVector ImVector_TextRange;
typedef ImVector ImVector_ImWchar;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
CIMGUI_API ImVec2* ImVec2_ImVec2(void);
CIMGUI_API void ImVec2_destroy(ImVec2* self);

View File

@@ -418,11 +418,15 @@ local function struct_parser()
--nothing
else
local linea = line:gsub("%S+",{class="struct",mutable=""})
local template = linea:match("ImVector<([%w_]+)>")
if template then
ImVector_templates[template] = true
end
linea = linea:gsub("(%b<>)","/*%1*/") --comment template parameters
local template = linea:match("ImVector<(.+)>")
if template then
local te = template:gsub("%s","_")
te = te:gsub("%*","Ptr")
ImVector_templates[template] = true
linea = linea:gsub("(%b<>)","_"..te) --comment template parameters
end
--linea = linea:gsub("(%b<>)","/*%1*/") --comment template parameters
--linea = linea:gsub("<([%w_]+)>","_%1") --ImVector expand templates
table.insert(structcdefs,linea..comment)
end
return
@@ -602,8 +606,10 @@ local function func_parser()
-- end
--argscsinpars = argscsinpars:gsub("&","")
local template = argscsinpars:match("ImVector<([%w_]+)>")
local template = argscsinpars:match("ImVector<(.+)>")
if template then
--template = template:gsub("%s","_")
--template = template:gsub("%*","Ptr")
ImVector_templates[template] = true
end
@@ -929,8 +935,14 @@ local function gen_structs_and_enums_table(cdefs)
end
--split type name1,name2; in several lines
local typen,rest = line:match("([^,]+)%s(%S+[,;])")
local template_type = typen:match("/%*<(.+)>%*/")
if template_type then typen = typen:match("(.+)/%*") end
--local template_type = typen:match("/%*<(.+)>%*/")
--if template_type then typen = typen:match("(.+)/%*") end
local template_type = typen:match("ImVector_(.+)")
if template_type then
typen = "ImVector"
template_type = template_type:gsub("_"," ")
template_type = template_type:gsub("Ptr","%*")
end
for name in rest:gmatch("([^%s,;]+)%s?[,;]") do
table.insert(outtab.structs[structnames[#structnames]],{type=typen,template_type=template_type,name=name})
end
@@ -985,8 +997,18 @@ local function gen_structs_and_enums_table(cdefs)
return outtab, typedefs_dict
end
local function generate_templates(code,templates,typedefs)
for k,v in pairs(templates) do
--[[typedef struct ImVector{int Size;int Capacity;void* Data;} ImVector;]]
local te = k:gsub("%s","_")
te = te:gsub("%*","Ptr")
--table.insert(code,"typedef struct ImVector_"..te.." {int Size;int Capacity;"..k.."* Data;} ImVector_"..te..";\n")
table.insert(code,"struct ImVector_"..te.." {int Size;int Capacity;"..k.."* Data;} ImVector_"..te..";\n")
table.insert(typedefs,"typedef struct ImVector_"..te.." ImVector_"..te..";\n")
end
end
local function gen_structs_and_enums(cdefs)
local function gen_structs_and_enums(cdefs,templates)
local function_closing_re = "}"
local namespace_re = "namespace"
local in_namespace = false
@@ -998,7 +1020,7 @@ local function gen_structs_and_enums(cdefs)
local innerstructs = {}
local typedefs_table = {}
local typedefs_dict = {}
local linetypedefs = 1 --math.huge
local outtab = {}
-- Output the file
--table.insert(outtab,"/////////////// BEGIN AUTOGENERATED SEGMENT\n")
@@ -1027,15 +1049,8 @@ local function gen_structs_and_enums(cdefs)
-- ImVector special treatment
if structnames[#structnames] == "ImVector" then
if line:match(struct_closing_re) then
table.insert(outtab,[[
struct ImVector
{
int Size;
int Capacity;
void* Data;
};
typedef struct ImVector ImVector;
]])
table.insert(outtab,[[typedef struct ImVector{int Size;int Capacity;void* Data;} ImVector;]].."\n")
generate_templates(outtab,templates,typedefs_table)
structnames[#structnames] = nil
end
break -- dont write
@@ -1049,9 +1064,14 @@ typedef struct ImVector ImVector;
end
if #structnames < 2 then -- not inner
if line:match("typedef") and line:match("ImDrawIdx") then --save typedefs of ImDrawIdx
table.insert(typedefs_table,line..";\n")
--linetypedefs = math.min(linetypedefs,#outtab)
break
end
if (#structnames > 0) then
if line:match("typedef") then --dont allow inner typedefs
break
break --already saved
elseif not line:match("^{$") and not line:match(struct_closing_re) then --avoid tab { and };
--line = " "..line
end
@@ -1060,6 +1080,7 @@ typedef struct ImVector ImVector;
local struct_closed_name = line:match(struct_closed_re)
if struct_closed_name then
table.insert(typedefs_table,"typedef struct "..struct_closed_name.." "..struct_closed_name..";\n")
--linetypedefs = math.min(linetypedefs,#outtab)
typedefs_dict[struct_closed_name] = "struct "..struct_closed_name
end
end
@@ -1076,6 +1097,7 @@ typedef struct ImVector ImVector;
local structname = structnames[#structnames]
--st[#st + 1] = string.format("typedef struct %s %s;\n",structname,structname)
table.insert(typedefs_table,string.format("typedef struct %s %s;\n",structname,structname))
--linetypedefs = math.min(linetypedefs,#outtab)
typedefs_dict[structname] = "struct "..structname
structnames[#structnames] = nil
end
@@ -1083,6 +1105,7 @@ typedef struct ImVector ImVector;
local structname = structnames[#structnames]
--table.insert(outtab,"typedef struct "..structname.." "..structname..";\n")
table.insert(typedefs_table,"typedef struct "..structname.." "..structname..";\n")
--linetypedefs = math.min(linetypedefs,#outtab)
typedefs_dict[structname] = "struct "..structname
structnames[#structnames] = nil
end
@@ -1102,7 +1125,7 @@ typedef struct ImVector ImVector;
for i,l in ipairs(typedefs_table) do
if not uniques[l] then
uniques[l] = true
table.insert(outtab,2,l)
table.insert(outtab,linetypedefs,l)
end
end
local cstructsstr = table.concat(outtab)
@@ -1145,10 +1168,10 @@ local function func_header_generate(FP)
for k,v in pairs(FP.ImVector_templates) do
table.insert(outtab,"typedef ImVector<"..k.."> ImVector_"..k..";\n")
end
table.insert(outtab,"#else //CIMGUI_DEFINE_ENUMS_AND_STRUCTS\n")
for k,v in pairs(FP.ImVector_templates) do
table.insert(outtab,"typedef ImVector ImVector_"..k..";\n")
end
-- table.insert(outtab,"#else //CIMGUI_DEFINE_ENUMS_AND_STRUCTS\n")
-- for k,v in pairs(FP.ImVector_templates) do
-- table.insert(outtab,"typedef ImVector ImVector_"..k..";\n")
-- end
table.insert(outtab,"#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS\n")
for _,t in ipairs(FP.cdefs) do
if t.cimguiname then
@@ -1389,11 +1412,13 @@ local function set_defines(fdefs)
end
--generate cimgui.cpp cimgui.h and auto versions depending on postfix
local function cimgui_generation(postfix,STP,FP)
--get all ImVector templates
local ImVector_templates = mergeT(STP.ImVector_templates,FP.ImVector_templates)
--merge it in cimgui_template.h to cimgui.h
local hfile = io.open("./cimgui_template.h","r")
local hstrfile = hfile:read"*a"
hfile:close()
local cstructsstr,typedefs_dict = gen_structs_and_enums(STP.lines)
local cstructsstr,typedefs_dict = gen_structs_and_enums(STP.lines,ImVector_templates)
--for not gcc parsing
if postfix == "_nopreprocess" then
cstructsstr = "typedef unsigned short ImDrawIdx;\ntypedef void* ImTextureID;\n"..cstructsstr

View File

@@ -40,12 +40,30 @@ typedef struct ImColor_Simple { ImVec4_Simple Value;} ImColor_Simple;
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
struct ImDrawChannel;
typedef struct CustomRect CustomRect;
typedef struct GlyphRangesBuilder GlyphRangesBuilder;
typedef struct ImFontGlyph ImFontGlyph;
typedef unsigned short ImDrawIdx;;
typedef struct Pair Pair;
typedef struct TextRange TextRange;
typedef struct ImVector_ImVec2 ImVector_ImVec2;
typedef struct ImVector_ImDrawIdx ImVector_ImDrawIdx;
typedef struct ImVector_ImVec4 ImVector_ImVec4;
typedef struct ImVector_TextRange ImVector_TextRange;
typedef struct ImVector_ImFontPtr ImVector_ImFontPtr;
typedef struct ImVector_ImDrawCmd ImVector_ImDrawCmd;
typedef struct ImVector_ImDrawVert ImVector_ImDrawVert;
typedef struct ImVector_unsigned_short ImVector_unsigned_short;
typedef struct ImVector_ImTextureID ImVector_ImTextureID;
typedef struct ImVector_char ImVector_char;
typedef struct ImVector_ImDrawChannel ImVector_ImDrawChannel;
typedef struct ImVector_CustomRect ImVector_CustomRect;
typedef struct ImVector_Pair ImVector_Pair;
typedef struct ImVector_unsigned_char ImVector_unsigned_char;
typedef struct ImVector_ImFontGlyph ImVector_ImFontGlyph;
typedef struct ImVector_ImFontConfig ImVector_ImFontConfig;
typedef struct ImVector_ImWchar ImVector_ImWchar;
typedef struct ImVector_float ImVector_float;
typedef struct ImVec4 ImVec4;
typedef struct ImVec2 ImVec2;
typedef struct ImGuiTextBuffer ImGuiTextBuffer;
@@ -69,6 +87,7 @@ typedef struct ImDrawList ImDrawList;
typedef struct ImDrawData ImDrawData;
typedef struct ImDrawCmd ImDrawCmd;
typedef struct ImDrawChannel ImDrawChannel;
struct ImDrawChannel;
struct ImDrawCmd;
struct ImDrawData;
struct ImDrawList;
@@ -568,13 +587,25 @@ struct ImGuiIO
float NavInputsDownDuration[ImGuiNavInput_COUNT];
float NavInputsDownDurationPrev[ImGuiNavInput_COUNT];
};
struct ImVector
{
int Size;
int Capacity;
void* Data;
};
typedef struct ImVector ImVector;
typedef struct ImVector{int Size;int Capacity;void* Data;} ImVector;
struct ImVector_float {int Size;int Capacity;float* Data;} ImVector_float;
struct ImVector_ImWchar {int Size;int Capacity;ImWchar* Data;} ImVector_ImWchar;
struct ImVector_ImFontConfig {int Size;int Capacity;ImFontConfig* Data;} ImVector_ImFontConfig;
struct ImVector_ImFontGlyph {int Size;int Capacity;ImFontGlyph* Data;} ImVector_ImFontGlyph;
struct ImVector_unsigned_char {int Size;int Capacity;unsigned char* Data;} ImVector_unsigned_char;
struct ImVector_Pair {int Size;int Capacity;Pair* Data;} ImVector_Pair;
struct ImVector_CustomRect {int Size;int Capacity;CustomRect* Data;} ImVector_CustomRect;
struct ImVector_ImDrawChannel {int Size;int Capacity;ImDrawChannel* Data;} ImVector_ImDrawChannel;
struct ImVector_char {int Size;int Capacity;char* Data;} ImVector_char;
struct ImVector_ImTextureID {int Size;int Capacity;ImTextureID* Data;} ImVector_ImTextureID;
struct ImVector_unsigned_short {int Size;int Capacity;unsigned short* Data;} ImVector_unsigned_short;
struct ImVector_ImDrawVert {int Size;int Capacity;ImDrawVert* Data;} ImVector_ImDrawVert;
struct ImVector_ImDrawCmd {int Size;int Capacity;ImDrawCmd* Data;} ImVector_ImDrawCmd;
struct ImVector_ImFontPtr {int Size;int Capacity;ImFont** Data;} ImVector_ImFontPtr;
struct ImVector_TextRange {int Size;int Capacity;TextRange* Data;} ImVector_TextRange;
struct ImVector_ImVec4 {int Size;int Capacity;ImVec4* Data;} ImVector_ImVec4;
struct ImVector_ImDrawIdx {int Size;int Capacity;ImDrawIdx* Data;} ImVector_ImDrawIdx;
struct ImVector_ImVec2 {int Size;int Capacity;ImVec2* Data;} ImVector_ImVec2;
struct ImNewDummy {};
struct ImGuiOnceUponAFrame
{
@@ -583,16 +614,16 @@ struct ImGuiOnceUponAFrame
struct ImGuiTextFilter
{
char InputBuf[256];
ImVector/*<TextRange>*/ Filters;
ImVector_TextRange Filters;
int CountGrep;
};
struct ImGuiTextBuffer
{
ImVector/*<char>*/ Buf;
ImVector_char Buf;
};
struct ImGuiStorage
{
ImVector/*<Pair>*/ Data;
ImVector_Pair Data;
};
struct ImGuiInputTextCallbackData
{
@@ -646,7 +677,6 @@ struct ImDrawCmd
ImDrawCallback UserCallback;
void* UserCallbackData;
};
typedef unsigned short ImDrawIdx;
struct ImDrawVert
{
ImVec2 pos;
@@ -655,8 +685,8 @@ struct ImDrawVert
};
struct ImDrawChannel
{
ImVector/*<ImDrawCmd>*/ CmdBuffer;
ImVector/*<ImDrawIdx>*/ IdxBuffer;
ImVector_ImDrawCmd CmdBuffer;
ImVector_ImDrawIdx IdxBuffer;
};
enum ImDrawCornerFlags_
{
@@ -677,21 +707,21 @@ enum ImDrawListFlags_
};
struct ImDrawList
{
ImVector/*<ImDrawCmd>*/ CmdBuffer;
ImVector/*<ImDrawIdx>*/ IdxBuffer;
ImVector/*<ImDrawVert>*/ VtxBuffer;
ImVector_ImDrawCmd CmdBuffer;
ImVector_ImDrawIdx IdxBuffer;
ImVector_ImDrawVert VtxBuffer;
ImDrawListFlags Flags;
const ImDrawListSharedData* _Data;
const char* _OwnerName;
unsigned int _VtxCurrentIdx;
ImDrawVert* _VtxWritePtr;
ImDrawIdx* _IdxWritePtr;
ImVector/*<ImVec4>*/ _ClipRectStack;
ImVector/*<ImTextureID>*/ _TextureIdStack;
ImVector/*<ImVec2>*/ _Path;
ImVector_ImVec4 _ClipRectStack;
ImVector_ImTextureID _TextureIdStack;
ImVector_ImVec2 _Path;
int _ChannelsCurrent;
int _ChannelsCount;
ImVector/*<ImDrawChannel>*/ _Channels;
ImVector_ImDrawChannel _Channels;
};
struct ImDrawData
{
@@ -750,9 +780,9 @@ struct ImFontAtlas
int TexHeight;
ImVec2 TexUvScale;
ImVec2 TexUvWhitePixel;
ImVector/*<ImFont*>*/ Fonts;
ImVector/*<CustomRect>*/ CustomRects;
ImVector/*<ImFontConfig>*/ ConfigData;
ImVector_ImFontPtr Fonts;
ImVector_CustomRect CustomRects;
ImVector_ImFontConfig ConfigData;
int CustomRectIds[1];
};
struct ImFont
@@ -760,9 +790,9 @@ struct ImFont
float FontSize;
float Scale;
ImVec2 DisplayOffset;
ImVector/*<ImFontGlyph>*/ Glyphs;
ImVector/*<float>*/ IndexAdvanceX;
ImVector/*<unsigned short>*/ IndexLookup;
ImVector_ImFontGlyph Glyphs;
ImVector_float IndexAdvanceX;
ImVector_unsigned_short IndexLookup;
const ImFontGlyph* FallbackGlyph;
float FallbackAdvanceX;
ImWchar FallbackChar;
@@ -775,7 +805,7 @@ struct ImFont
};
struct GlyphRangesBuilder
{
ImVector/*<unsigned char>*/ UsedChars;
ImVector_unsigned_char UsedChars;
};
struct CustomRect
{
@@ -832,9 +862,6 @@ typedef ImGuiTextFilter::TextRange TextRange;
typedef ImGuiStorage::Pair Pair;
typedef ImVector<TextRange> ImVector_TextRange;
typedef ImVector<ImWchar> ImVector_ImWchar;
#else //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
typedef ImVector ImVector_TextRange;
typedef ImVector ImVector_ImWchar;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
CIMGUI_API ImVec2* ImVec2_ImVec2(void);
CIMGUI_API void ImVec2_destroy(ImVec2* self);

View File

@@ -1,6 +1,6 @@
struct GLFWwindow;
typedef struct SDL_Window SDL_Window;
typedef struct GLFWwindow GLFWwindow;
struct GLFWwindow;
struct SDL_Window;
typedef union SDL_Event SDL_Event;
CIMGUI_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window,bool install_callbacks);