Browse Source

MSVC: disabling warnings

example: output frame time
pull/1/head
Leonard Ritter 10 years ago
parent
commit
5e8a29038d
3 changed files with 25 additions and 8 deletions
  1. +2
    -0
      blendish.h
  2. +12
    -0
      example.cpp
  3. +11
    -8
      oui.h

+ 2
- 0
blendish.h View File

@@ -1089,6 +1089,8 @@ BND_EXPORT NVGcolor bndNodeWireColor(const BNDnodeTheme *theme, BNDwidgetState s
#ifdef _MSC_VER
#pragma warning (disable: 4996) // Switch off security warnings
#pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings
#pragma warning (disable: 4244)
#pragma warning (disable: 4305)
#ifdef __cplusplus
#define BND_INLINE inline
#else


+ 12
- 0
example.cpp View File

@@ -1213,6 +1213,9 @@ int main()

glfwSetTime(0);

double c = 0.0;
int total = 0;

while (!glfwWindowShouldClose(window))
{
double mx, my;
@@ -1231,11 +1234,20 @@ int main()
glClearColor(0,0,0,1);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);

double t = glfwGetTime();
nvgBeginFrame(_vg, winWidth, winHeight, pxRatio);

draw(_vg, winWidth, winHeight);

nvgEndFrame(_vg);
double t2 = glfwGetTime();
c += (t2 - t);
total++;
if (total > (1*60)) {
printf("%fms\n", (c / (double)total)*1000.0);
total = 0;
c = 0.0;
}

glfwSwapBuffers(window);
glfwPollEvents();


+ 11
- 8
oui.h View File

@@ -678,15 +678,18 @@ OUI_EXPORT short uiGetMarginDown(int item);
#include <assert.h>

#ifdef _MSC_VER
#pragma warning (disable: 4996) // Switch off security warnings
#pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings
#ifdef __cplusplus
#define UI_INLINE inline
#else
#define UI_INLINE
#endif
#pragma warning (disable: 4996) // Switch off security warnings
#pragma warning (disable: 4100) // Switch off unreferenced formal parameter warnings
#pragma warning (disable: 4244)
#pragma warning (disable: 4305)

#ifdef __cplusplus
#define UI_INLINE inline
#else
#define UI_INLINE
#endif
#else
#define UI_INLINE inline
#define UI_INLINE inline
#endif

#define UI_MAX_KIND 16


Loading…
Cancel
Save