Skip to content

Commit

Permalink
Reverted to old mouse input routine on Windows (new had issues at low…
Browse files Browse the repository at this point in the history
… framerate), added operating system info to OpenCL device driver version printout, version bump to v2.11
  • Loading branch information
ProjectPhysX committed Dec 7, 2023
1 parent d8e84c2 commit ac37729
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ The fastest and most memory efficient lattice Boltzmann CFD software, running on
- replaced slow (in multithreading) `std::rand()` function with standard C99 LCG
- more robust correction of wrong VRAM capacity reporting on Intel Arc GPUs
- fixed some minor compiler warnings
- v2.11 (07.12.2023)
- interactive graphics on Linux are now in fullscreen mode too, fully matching Windows
- made CPU/GPU buffer initialization significantly faster with `std::fill` and `enqueueFillBuffer` (overall ~8% faster simulation startup)
- added operating system info to OpenCL device driver version printout
- fixed flickering with frustrum culling at very small field of view
- fixed bug where rendered/exported frame was not updated when `visualization_modes` changed

</details>

Expand Down
2 changes: 1 addition & 1 deletion src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ void update_frame(const double frametime) {
SetBitmapBits(frameDC, 4*(int)camera.width*(int)camera.height, camera.bitmap);
BitBlt(displayDC, 0, 0, (int)camera.width, (int)camera.height, memDC, 0, 0, SRCCOPY); // copy back buffer to front buffer
camera.clear_frame(); // clear frame
if(!camera.lockmouse) SetCursorPos((int)camera.width/2, (int)camera.height/2); // center cursor
}
LRESULT CALLBACK WndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam) {
if(message==WM_DESTROY) {
Expand All @@ -479,6 +478,7 @@ LRESULT CALLBACK WndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam
exit(0);
} else if(message==WM_MOUSEMOVE) {
camera.input_mouse_moved((int)LOWORD(lParam), (int)HIWORD(lParam));
if(!camera.lockmouse) SetCursorPos((int)camera.width/2, (int)camera.height/2); // center cursor
} else if(message==WM_MOUSEWHEEL) {
if((short)HIWORD(wParam)>0) camera.input_scroll_up(); else camera.input_scroll_down();
} else if(message==WM_LBUTTONDOWN||message==WM_MBUTTONDOWN||message==WM_RBUTTONDOWN) {
Expand Down
2 changes: 1 addition & 1 deletion src/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void Info::print_logo() const {
print("| "); print("\\ \\ / /", c); print(" |\n");
print("| "); print("\\ ' /", c); print(" |\n");
print("| "); print("\\ /", c); print(" |\n");
print("| "); print("\\ /", c); print(" FluidX3D Version 2.10 |\n");
print("| "); print("\\ /", c); print(" FluidX3D Version 2.11 |\n");
print("| "); print("'", c); print(" Copyright (c) Dr. Moritz Lehmann |\n");
print("|-----------------------------------------------------------------------------|\n");
}
Expand Down
19 changes: 14 additions & 5 deletions src/opencl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,21 @@ struct Device_Info {

string get_opencl_c_code(); // implemented in kernel.hpp
inline void print_device_info(const Device_Info& d) { // print OpenCL device info
#if defined(_WIN32)
const string os = "Windows";
#elif defined(__linux__)
const string os = "Linux";
#elif defined(__APPLE__)
const string os = "macOS";
#else // unknown operating system
const string os = "unknown operating system";
#endif // operating system
println("\r|----------------.------------------------------------------------------------|");
println("| Device ID | "+alignl(58, to_string(d.id) )+" |");
println("| Device Name | "+alignl(58, d.name )+" |");
println("| Device Vendor | "+alignl(58, d.vendor )+" |");
println("| Device Driver | "+alignl(58, d.driver_version )+" |");
println("| OpenCL Version | "+alignl(58, d.opencl_c_version )+" |");
println("| Device ID | "+alignl(58, to_string(d.id) )+" |");
println("| Device Name | "+alignl(58, d.name )+" |");
println("| Device Vendor | "+alignl(58, d.vendor )+" |");
println("| Device Driver | "+alignl(58, d.driver_version+" ("+os+")")+" |");
println("| OpenCL Version | "+alignl(58, d.opencl_c_version )+" |");
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)")+" |");
println("| Memory, Cache | "+alignl(58, to_string(d.memory)+" MB, "+to_string(d.global_cache)+" KB global / "+to_string(d.local_cache)+" KB local")+" |");
println("| Buffer Limits | "+alignl(58, to_string(d.max_global_buffer)+" MB global, "+to_string(d.max_constant_buffer)+" KB constant")+" |");
Expand Down

0 comments on commit ac37729

Please sign in to comment.