40 static const F32 s_highlightFadeDuration = 3.0f;
41 static const F32 s_highlightFadeSpeed = 3.0f;
42 static const F32 s_initFrameTime = 1.0f / 60.0f;
47 : m_features (features),
50 m_showControls (true),
53 m_sliderStackBegun (false),
54 m_sliderStackEmpty (false),
55 m_controlVisibility (true),
62 m_avgFrameTime (s_initFrameTime),
69 char moduleFullName[256];
70 GetModuleFileName(GetModuleHandle(
NULL), moduleFullName,
sizeof(moduleFullName) - 1);
71 moduleFullName[
sizeof(moduleFullName) - 1] =
'\0';
75 const char* moduleShortName = moduleFullName;
76 for (
int i = 0; moduleFullName[i]; i++)
77 if (moduleFullName[i] ==
'/' || moduleFullName[i] ==
'\\')
78 moduleShortName = &moduleFullName[i + 1];
79 else if (moduleFullName[i] ==
'.')
80 moduleFullName[i] =
'\0';
84 m_stateFilePrefix =
sprintf(
"state_%s_", moduleShortName);
85 m_screenshotFilePrefix =
sprintf(
"screenshot_%s_", moduleShortName);
100 bool stopPropagation =
false;
109 m_avgFrameTime = s_initFrameTime;
110 m_screenshot =
false;
135 m_showFPS = (!m_showFPS);
136 m_avgFrameTime = s_initFrameTime;
141 m_showControls = (!m_showControls);
152 stopPropagation =
true;
153 if (m_activeToggle != -1)
154 selectToggle(m_toggles[m_activeToggle]);
158 stopPropagation =
true;
159 enterSliderValue(m_sliders[m_activeSlider]);
182 const Key* key = getKey(ev.
key);
183 for (
int i = 0; i < key->toggles.getSize(); i++)
185 selectToggle(key->toggles[i]);
191 for (
int i = 0; i < key->sliderIncrease.getSize(); i++)
192 sliderKeyDown(key->sliderIncrease[i], 1);
193 for (
int i = 0; i < key->sliderDecrease.getSize(); i++)
194 sliderKeyDown(key->sliderDecrease[i], -1);
195 if (key->sliderIncrease.getSize() || key->sliderDecrease.getSize())
209 stopPropagation =
true;
214 if (m_dragging && m_activeSlider != -1)
216 Slider* s = m_sliders[m_activeSlider];
217 setSliderY(s, getSliderY(s,
true) - ev.
mouseDelta.y);
228 gl = m_window->
getGL();
238 if (m_activeSlider != -1)
240 m_sliders[m_activeSlider]->highlightTime =
FW_F32_MAX;
244 if (m_activeToggle != -1)
246 m_toggles[m_activeToggle]->highlightTime =
FW_F32_MAX;
253 return stopPropagation;
261 for (
int i = 0; i < m_messages.
getSize(); i++)
262 if (m_messages[i].volatileID == volatileID)
274 msg.volatileID = volatileID;
276 m_messages.
insert(0, msg);
288 for (
int i = 0; i < m_toggles.
getSize(); i++)
290 Toggle* t = m_toggles[i];
291 if (t->boolTarget != target && t->enumTarget != target)
295 delete m_toggles.
remove(i--);
298 for (
int i = 0; i < m_sliders.
getSize(); i++)
300 Slider* s = m_sliders[i];
301 if (s->floatTarget != target && s->intTarget != target)
304 if (!s->stackWithPrevious && i < m_sliders.
getSize() - 1)
305 m_sliders[i + 1]->stackWithPrevious =
false;
308 s->decreaseKey->sliderDecrease.removeItem(s);
309 delete m_sliders.
remove(i--);
317 for (
int i = 0; i < m_toggles.
getSize(); i++)
321 for (
int i = 0; i < m_sliders.
getSize(); i++)
325 for (
int slot = m_keyHash.firstSlot(); slot != -1; slot = m_keyHash.nextSlot(slot))
326 delete m_keyHash.getSlot(slot).value;
340 SystemTimeToFileTime(&st, &ft);
341 U64 stamp = *(
const U64*)&ft;
344 for (
int i = 60; i >= 0; i -= 4)
345 name += (
char)(
'a' + ((stamp >> i) & 15));
363 if (
String(tag) !=
"FWState ")
373 for (
int i = 0; i < m_stateObjs.getSize(); i++)
374 m_stateObjs[i]->readState(dump);
423 for (
int i = 0; i < m_stateObjs.getSize(); i++)
424 m_stateObjs[i]->writeState(dump);
431 file.
write(
"FWState ", 8);
463 for (
int i = 0; i < m_toggles.
getSize(); i++)
471 void CommonControls::render(
GLContext* gl)
475 glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT);
476 glDisable(GL_DEPTH_TEST);
477 glDisable(GL_CULL_FACE);
480 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
483 bool repaint =
false;
495 glReadPixels(0, 0, size.x, size.y, GL_RGBA, GL_UNSIGNED_BYTE,
image.getMutablePtr());
499 for (
int i = 0; i < 3; i++)
501 glDrawPixels(size.x, size.y, GL_RGBA, GL_UNSIGNED_BYTE,
image.getPtr());
504 glDrawPixels(size.x, size.y, GL_RGBA, GL_UNSIGNED_BYTE,
image.getPtr());
505 showControls =
false;
514 m_screenshot =
false;
519 F32 timeDelta = m_timer.
end();
523 for (
int i = 0; i < m_toggles.
getSize(); i++)
525 Toggle* t = m_toggles[i];
526 F32 fade = updateHighlightFade(&t->highlightTime);
527 bool down = (!t->isButton || (m_activeToggle == i && m_dragging));
528 if (!showControls || !t->visible || t->isSeparator)
531 drawPanel(gl, t->pos + t->size * 0.5f, t->size,
532 0x80808080, (down) ? 0x80000000 : 0x80FFFFFF, (down) ? 0x80FFFFFF : 0x80000000);
535 drawPanel(gl, t->pos + t->size * 0.5f, t->size - 2.0f,
536 0x80808080, (down) ? 0xFF000000 : 0xFFFFFFFF, (down) ? 0xFFFFFFFF : 0xFF000000);
540 if ((t->boolTarget && *t->boolTarget) ||
541 (t->enumTarget && *t->enumTarget == t->enumValue))
543 drawPanel(gl, t->pos + t->size * 0.5f, t->size - 4.0f,
544 0x80808080, 0xFFFFFFFF, 0xFF000000);
548 if (fade < 1.0
f && m_activeToggle != i)
552 fadeABGR(0xFFFFFFFF, fade));
560 for (
int i = 0; i < m_sliders.
getSize(); i++)
562 Slider* s = m_sliders[i];
564 if (m_window->
isKeyDown(s->increaseKey->id))
566 if (m_window->
isKeyDown(s->decreaseKey->id))
572 setSliderValue(s, getSliderValue(s,
true) + delta * timeDelta * s->speed);
577 F32 fade = updateHighlightFade(&s->highlightTime);
578 bool down = (m_activeSlider == i && m_dragging);
579 if (!showControls || !s->visible)
582 drawPanel(gl, s->pos + s->size * 0.5f, s->size,
583 0x80808080, 0x80000000, 0x80FFFFFF);
585 drawPanel(gl, s->blockPos + s->blockSize * 0.5f, s->blockSize,
586 0x80808080, (down) ? 0xFF000000 : 0xFFFFFFFF, (down) ? 0xFFFFFFFF : 0xFF000000);
588 if (fade < 1.0
f && m_activeSlider != i)
591 Vec2f(s->pos.x - 4.0f, s->blockPos.y + s->blockSize.y * 0.5f),
592 Vec2f(1.0
f, 0.5
f), fadeABGR(0xFFFFFFFF, fade));
601 m_avgFrameTime =
lerp(timeDelta, m_avgFrameTime,
exp2(-timeDelta / 0.3
f));
604 Vec2f(m_rightX - 4.0
f, m_viewSize.y - 2.0f),
605 Vec2f(1.0
f, 1.0
f), 0xFFFFFFFF);
612 for (
int i = 0; i < m_messages.
getSize(); i++)
614 Message& msg = m_messages[i];
615 F32 fade = updateHighlightFade(&msg.highlightTime);
617 if (fade >= 1.0
f || (i && messageY >= m_viewSize.y))
624 gl->
drawLabel(msg.string,
Vec2f(4.0
f, messageY), 0.0
f, fadeABGR(msg.abgr, fade));
626 messageY += m_fontHeight;
633 if (m_activeToggle != -1)
635 Toggle* t = m_toggles[m_activeToggle];
639 t->pos +
Vec2f(-5.0
f, t->size.y * 0.5f),
Vec2f(1.0
f, 0.5
f), 0xFFFFFFFF);
643 if (m_activeSlider != -1)
645 Slider* s = m_sliders[m_activeSlider];
649 Vec2f(s->pos.x - 4.0f, s->blockPos.y + s->blockSize.y * 0.5f),
Vec2f(1.0
f, 0.5
f), 0xFFFFFFFF);
669 Toggle* t =
new Toggle;
670 t->boolTarget = boolTarget;
671 t->enumTarget = enumTarget;
672 t->enumValue = enumValue;
673 t->dirtyNotify = dirtyNotify;
675 t->isButton = isButton;
676 t->isSeparator = (!boolTarget && !enumTarget);
677 t->key = getKey(key);
681 t->visible = m_controlVisibility;
686 t->key->toggles.add(t);
688 if (m_showControls && m_window)
698 Slider* s =
new Slider;
699 s->floatTarget = floatTarget;
700 s->intTarget = intTarget;
701 s->dirtyNotify = dirtyNotify;
704 s->minValue = minValue;
705 s->maxValue = maxValue;
706 s->isExponential = isExponential;
707 s->increaseKey = getKey(increaseKey);
708 s->decreaseKey = getKey(decreaseKey);
713 s->visible = m_controlVisibility;
714 s->stackWithPrevious = (m_sliderStackBegun && !m_sliderStackEmpty);
717 s->blockPos =
Vec2f(0.0
f);
718 s->blockSize =
Vec2f(0.0
f);
721 s->increaseKey->sliderIncrease.add(s);
722 s->decreaseKey->sliderDecrease.add(s);
724 m_sliderStackEmpty =
false;
726 if (m_showControls && m_window)
732 CommonControls::Key* CommonControls::getKey(
const String&
id)
734 Key** found = m_keyHash.search(
id);
740 m_keyHash.add(
id, key);
746 void CommonControls::layout(
const Vec2f& viewSize,
F32 fontHeight)
750 m_viewSize = viewSize;
751 m_fontHeight = fontHeight;
752 m_rightX = m_viewSize.x;
756 F32 sliderW = m_fontHeight;
757 for (
int startSlider = m_sliders.
getSize() - 1; startSlider >= 0; startSlider--)
759 int endSlider = startSlider + 1;
760 while (startSlider && m_sliders[startSlider]->stackWithPrevious)
764 for (
int i = startSlider; i < endSlider; i++)
765 if (m_sliders[i]->visible)
772 for (
int i = endSlider - 1; i >= startSlider; i--)
774 Slider* s = m_sliders[i];
778 s->size =
Vec2f(sliderW,
max(
floor((viewSize.y - sliderY) / (
F32)numVisible + 0.5f), 4.0f));
779 s->pos =
Vec2f(m_rightX, sliderY);
780 s->blockSize =
Vec2f(sliderW - 2.0
f,
min((m_fontHeight - 2.0
f) * 2.0
f, s->size.y * 0.25f));
781 s->blockPos =
Vec2f(m_rightX + 1.0
f, getSliderY(s,
false));
782 sliderY += s->size.y;
790 int maxInCol =
max((
int)(viewSize.y / toggleSize.y), 1);
792 int endIdx = m_toggles.
getSize();
796 while (endIdx > 0 && (!m_toggles[endIdx - 1]->visible || m_toggles[endIdx - 1]->isSeparator))
801 for (startIdx = endIdx; startIdx > 0; startIdx--)
803 const Toggle* t = m_toggles[startIdx - 1];
810 if (numInCol + numInStrip > maxInCol)
813 if (numInStrip > maxInCol)
818 for (
int i = endIdx - 1; i >= startIdx; i--)
820 Toggle* t = m_toggles[i];
825 m_rightX -= toggleSize.x;
826 t->pos =
Vec2f(m_rightX, numInCol * toggleSize.y);
827 t->size = toggleSize;
837 void CommonControls::clearActive(
void)
845 void CommonControls::updateActive(
const Vec2f& mousePos)
849 for (
int i = 0; i < m_toggles.
getSize(); i++)
851 Toggle* t = m_toggles[i];
852 if (t->visible && !t->isSeparator &&
853 mousePos.x >= t->pos.x && mousePos.x < t->pos.x + t->size.x &&
854 mousePos.y >= t->pos.y && mousePos.y < t->pos.y + t->size.y)
861 for (
int i = 0; i < m_sliders.
getSize(); i++)
863 Slider* s = m_sliders[i];
865 mousePos.x >= s->blockPos.x && mousePos.x < s->blockPos.x + s->blockSize.x &&
866 mousePos.y >= s->blockPos.y && mousePos.y < s->blockPos.y + s->blockSize.y)
876 F32 CommonControls::updateHighlightFade(
F32* highlightTime)
878 *highlightTime =
min(*highlightTime, m_timer.
getTotal());
879 return (m_timer.
getTotal() - *highlightTime) / s_highlightFadeDuration;
884 U32 CommonControls::fadeABGR(
U32 abgr,
F32 fade)
887 color.w *=
min((1.0
f - fade) * s_highlightFadeSpeed, 1.0
f);
893 void CommonControls::selectToggle(Toggle* t)
898 *t->boolTarget = (!*t->boolTarget);
902 if (*t->enumTarget == t->enumValue)
904 *t->enumTarget = t->enumValue;
908 *t->dirtyNotify =
true;
913 F32 CommonControls::getSliderY(
const Slider* s,
bool applySlack)
const
915 return getSliderValue(s, applySlack) * (s->size.y - s->blockSize.y - 3.0f) + s->pos.y + 2.0f;
920 void CommonControls::setSliderY(Slider* s,
F32 y)
922 setSliderValue(s, (y - s->pos.y - 2.0f) / (s->size.y - s->blockSize.y - 3.0f));
927 F32 CommonControls::getSliderValue(
const Slider* s,
bool applySlack)
930 F32 raw = (s->floatTarget) ? *s->floatTarget : (
F32)*s->intTarget;
931 F32 slacked = raw + ((applySlack) ? s->slack : 0.0f);
933 F32 relative = (s->isExponential) ?
934 (
log(slacked) -
log(s->minValue)) / (
log(s->maxValue) -
log(s->minValue)) :
935 (slacked - s->minValue) / (s->maxValue - s->minValue);
937 return clamp(relative, 0.0
f, 1.0
f);
942 void CommonControls::setSliderValue(Slider* s,
F32 v)
945 F32 clamped = clamp(v, 0.0
f, 1.0
f);
947 F32 raw = (s->isExponential) ?
949 lerp(s->minValue, s->maxValue, clamped);
954 dirty = (*s->floatTarget != raw);
955 *s->floatTarget = raw;
960 S32 rounded = (
S32)(raw + ((raw >= 0.0
f) ? 0.5f : -0.5f));
961 dirty = (*s->intTarget != rounded);
962 *s->intTarget = rounded;
963 s->slack = raw - (
F32)rounded;
966 if (dirty && s->dirtyNotify)
967 *s->dirtyNotify =
true;
972 String CommonControls::getSliderLabel(
const Slider* s)
976 return sprintf(s->format.getPtr(), *s->floatTarget);
977 return sprintf(s->format.getPtr(), *s->intTarget);
982 void CommonControls::sliderKeyDown(Slider* s,
int dir)
988 S32 oldValue = *s->intTarget;
989 *s->intTarget = clamp(*s->intTarget + dir, (
S32)s->minValue, (
S32)s->maxValue);
992 if (*s->intTarget != oldValue && s->dirtyNotify)
993 *s->dirtyNotify =
true;
998 void CommonControls::enterSliderValue(Slider* s)
1003 printf(
sprintf(
"\nEnter %s:\n", getSliderLabel(s).getPtr()).getPtr());
1011 if (scanf_s(
"%g", &fval))
1013 dirty = (*s->floatTarget != fval);
1014 *s->floatTarget = fval;
1019 printf(
"No value entered.\n");
1026 if (scanf_s(
"%d", &ival))
1028 dirty = (*s->intTarget != ival);
1029 *s->intTarget = ival;
1034 printf(
"No value entered.\n");
1039 if (dirty && s->dirtyNotify)
1040 *s->dirtyNotify =
true;
1047 void CommonControls::drawPanel(
GLContext* gl,
const Vec2f& pos,
const Vec2f& size,
U32 interiorABGR,
U32 topLeftABGR,
U32 bottomRightABGR)
1052 Vec2f c = pos * p - 1.0f;
1053 Vec2f r = (size * 0.5f - 1.0f) * p;
1054 Vec2f px(p.x, 0.0f);
1056 Vec2f rx(r.x, 0.0f);
1061 c + r, c - rx + ry, c + rx - ry, c - r,
1062 c - r, c - r - py, c + rx - ry, c + rx - ry + px - py, c + r, c + r + px,
1063 c + r + px, c + r +
p, c - rx + ry, c - rx + ry - px + py, c - r - py, c - r -
p,
1070 Vec4f colorAttrib[] =
1073 br, br, br, br, br, br,
1074 tl, tl, tl, tl, tl, tl,
1079 static const char* progId =
"CommonControls::drawPanel";
1085 attribute vec2 posAttrib;
1086 attribute vec4 colorAttrib;
1087 varying vec4 colorVarying;
1090 gl_Position = vec4(posAttrib, 0.0, 1.0);
1091 colorVarying = colorAttrib;
1095 varying vec4 colorVarying;
1098 gl_FragColor = colorVarying;
1109 glDrawArrays(GL_TRIANGLE_STRIP, 0,
FW_ARRAY_SIZE(posAttrib));
void exportImage(const String &fileName, const Image *image)
bool saveStateDialog(void)
int getFontHeight(void) const
const char * getPtr(void) const
virtual ~CommonControls(void)
Mat4f setVGXform(const Mat4f &m)
FW_CUDA_FUNC F64 exp(F64 a)
void showControls(bool show)
void setError(const char *fmt,...)
bool loadStateDialog(void)
Vec2i drawLabel(const String &str, const Vec4f &pos, const Vec2f &align, U32 fgABGR, U32 bgABGR)
void addToggle(bool *target, const String &key, const String &title, bool *dirtyNotify=NULL)
void addSlider(F32 *target, F32 minValue, F32 maxValue, bool isExponential, const String &increaseKey, const String &decreaseKey, const String &format, F32 speed=0.25f, bool *dirtyNotify=NULL)
CommonControls(U32 features=Feature_Default)
F32 getKeyBoost(void) const
FW_CUDA_FUNC F32 floor(F32 a)
void setProgram(const String &id, Program *prog)
bool loadState(const String &fileName)
#define FW_KEY_PRINT_SCREEN
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum target
bool restoreError(const String &old)
void toggleFullScreen(void)
String getScreenshotFileName(void) const
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat y
Program * getProgram(const String &id) const
bool removeItem(const T &item)
int main(int argc, char *argv[])
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v
GLint getAttribLoc(const String &name) const
const String & getError(void)
void setAttrib(int loc, int size, GLenum type, int stride, Buffer *buffer, const void *pointer)
FW_CUDA_FUNC T min(const VectorBase< T, L, S > &v)
void setVisible(bool visible)
FW_CUDA_FUNC T max(const VectorBase< T, L, S > &v)
#define FW_KEY_MOUSE_MIDDLE
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value glUseProgram
String showFileSaveDialog(const String &title, const String &filters="", const String &initialDir="", bool forceInitialDir=false)
int getLength(void) const
String showFileLoadDialog(const String &title, const String &filters="", const String &initialDir="", bool forceInitialDir=false)
bool isKeyDown(const String &key) const
Mat4f xformMatchPixels(void) const
String sprintf(const char *fmt,...)
String getStateFileName(int idx) const
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction f
void printf(const char *fmt,...)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
virtual void write(const void *ptr, int size)
void flashButtonTitles(void)
FW_CUDA_FUNC F64 log(F64 a)
#define FW_KEY_MOUSE_LEFT
static Vec4f fromABGR(U32 abgr)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void * p
const Vec2i & getViewSize(void) const
const Vec2f & getViewScale(void) const
#define FW_GL_SHADER_SOURCE(CODE)
virtual bool handleEvent(const Window::Event &ev)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void * image
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr size
void removeControl(const void *target)
bool saveState(const String &fileName)
FW_CUDA_FUNC A lerp(const A &a, const A &b, const B &t)
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat GLfloat z GLuint GLint GLenum GLboolean GLsizei const GLvoid pointer GLuint GLuint color
void message(const String &str, const String &volatileID="", U32 abgr=0xffffffffu)