Skip to content

Commit ac37729

Browse files
committed
Reverted to old mouse input routine on Windows (new had issues at low framerate), added operating system info to OpenCL device driver version printout, version bump to v2.11
1 parent d8e84c2 commit ac37729

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ The fastest and most memory efficient lattice Boltzmann CFD software, running on
106106
- replaced slow (in multithreading) `std::rand()` function with standard C99 LCG
107107
- more robust correction of wrong VRAM capacity reporting on Intel Arc GPUs
108108
- fixed some minor compiler warnings
109+
- v2.11 (07.12.2023)
110+
- interactive graphics on Linux are now in fullscreen mode too, fully matching Windows
111+
- made CPU/GPU buffer initialization significantly faster with `std::fill` and `enqueueFillBuffer` (overall ~8% faster simulation startup)
112+
- added operating system info to OpenCL device driver version printout
113+
- fixed flickering with frustrum culling at very small field of view
114+
- fixed bug where rendered/exported frame was not updated when `visualization_modes` changed
109115

110116
</details>
111117

src/graphics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ void update_frame(const double frametime) {
470470
SetBitmapBits(frameDC, 4*(int)camera.width*(int)camera.height, camera.bitmap);
471471
BitBlt(displayDC, 0, 0, (int)camera.width, (int)camera.height, memDC, 0, 0, SRCCOPY); // copy back buffer to front buffer
472472
camera.clear_frame(); // clear frame
473-
if(!camera.lockmouse) SetCursorPos((int)camera.width/2, (int)camera.height/2); // center cursor
474473
}
475474
LRESULT CALLBACK WndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam) {
476475
if(message==WM_DESTROY) {
@@ -479,6 +478,7 @@ LRESULT CALLBACK WndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam
479478
exit(0);
480479
} else if(message==WM_MOUSEMOVE) {
481480
camera.input_mouse_moved((int)LOWORD(lParam), (int)HIWORD(lParam));
481+
if(!camera.lockmouse) SetCursorPos((int)camera.width/2, (int)camera.height/2); // center cursor
482482
} else if(message==WM_MOUSEWHEEL) {
483483
if((short)HIWORD(wParam)>0) camera.input_scroll_up(); else camera.input_scroll_down();
484484
} else if(message==WM_LBUTTONDOWN||message==WM_MBUTTONDOWN||message==WM_RBUTTONDOWN) {

src/info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void Info::print_logo() const {
5555
print("| "); print("\\ \\ / /", c); print(" |\n");
5656
print("| "); print("\\ ' /", c); print(" |\n");
5757
print("| "); print("\\ /", c); print(" |\n");
58-
print("| "); print("\\ /", c); print(" FluidX3D Version 2.10 |\n");
58+
print("| "); print("\\ /", c); print(" FluidX3D Version 2.11 |\n");
5959
print("| "); print("'", c); print(" Copyright (c) Dr. Moritz Lehmann |\n");
6060
print("|-----------------------------------------------------------------------------|\n");
6161
}

src/opencl.hpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,21 @@ struct Device_Info {
8383

8484
string get_opencl_c_code(); // implemented in kernel.hpp
8585
inline void print_device_info(const Device_Info& d) { // print OpenCL device info
86+
#if defined(_WIN32)
87+
const string os = "Windows";
88+
#elif defined(__linux__)
89+
const string os = "Linux";
90+
#elif defined(__APPLE__)
91+
const string os = "macOS";
92+
#else // unknown operating system
93+
const string os = "unknown operating system";
94+
#endif // operating system
8695
println("\r|----------------.------------------------------------------------------------|");
87-
println("| Device ID | "+alignl(58, to_string(d.id) )+" |");
88-
println("| Device Name | "+alignl(58, d.name )+" |");
89-
println("| Device Vendor | "+alignl(58, d.vendor )+" |");
90-
println("| Device Driver | "+alignl(58, d.driver_version )+" |");
91-
println("| OpenCL Version | "+alignl(58, d.opencl_c_version )+" |");
96+
println("| Device ID | "+alignl(58, to_string(d.id) )+" |");
97+
println("| Device Name | "+alignl(58, d.name )+" |");
98+
println("| Device Vendor | "+alignl(58, d.vendor )+" |");
99+
println("| Device Driver | "+alignl(58, d.driver_version+" ("+os+")")+" |");
100+
println("| OpenCL Version | "+alignl(58, d.opencl_c_version )+" |");
92101
println("| Compute Units | "+alignl(58, to_string(d.compute_units)+" at "+to_string(d.clock_frequency)+" MHz ("+to_string(d.cores)+" cores, "+to_string(d.tflops, 3)+" TFLOPs/s)")+" |");
93102
println("| Memory, Cache | "+alignl(58, to_string(d.memory)+" MB, "+to_string(d.global_cache)+" KB global / "+to_string(d.local_cache)+" KB local")+" |");
94103
println("| Buffer Limits | "+alignl(58, to_string(d.max_global_buffer)+" MB global, "+to_string(d.max_constant_buffer)+" KB constant")+" |");

0 commit comments

Comments
 (0)