git.s-ol.nu ~forks/DiligentTools / 5776362
Fix misc. typos Found via `codespell` luz paz 4 months ago
17 changed file(s) with 27 addition(s) and 27 deletion(s). Raw diff Collapse all Expand all
00 # Asset Loader
11
2 The asset loading libary currently supports GLTF 2.0 format.
2 The asset loading library currently supports GLTF 2.0 format.
33
44 ## GLTF 2.0
55
219219 if (pSkin != nullptr)
220220 {
221221 // Update join matrices
222 auto InverseTransform = pMesh->Transforms.matrix.Inverse(); // TODO: do not use inverse tranform here
222 auto InverseTransform = pMesh->Transforms.matrix.Inverse(); // TODO: do not use inverse transform here
223223 if (pMesh->Transforms.jointMatrices.size() != pSkin->Joints.size())
224224 pMesh->Transforms.jointMatrices.resize(pSkin->Joints.size());
225225 for (size_t i = 0; i < pSkin->Joints.size(); i++)
122122 m_ShaderType = SHADER_TYPE_COMPUTE;
123123 else
124124 {
125 LOG_ERROR_MESSAGE("Unknow shader type ", argv[a], "; Allowed values: vs,gs,ps,ds,hs,cs");
125 LOG_ERROR_MESSAGE("Unknown shader type ", argv[a], "; Allowed values: vs,gs,ps,ds,hs,cs");
126126 return -1;
127127 }
128128 }
136136 }
137137 else
138138 {
139 LOG_ERROR_MESSAGE("Unknow command line option ", argv[a]);
139 LOG_ERROR_MESSAGE("Unknown command line option ", argv[a]);
140140 return -1;
141141 }
142142 }
10921092 void *context,
10931093 ArAvailability *out_availability);
10941094
1095 /// Initiates installation of ARCore if needed. When your apllication launches
1095 /// Initiates installation of ARCore if needed. When your application launches
10961096 /// or enters an AR mode, it should call this method with @c
10971097 /// user_requested_install = 1.
10981098 ///
19951995 /// @param[in] session The ARCore session
19961996 /// @param[in] pose The pose to convert
19971997 /// @param[out] out_matrix_col_major_4x4 Pointer to an array of 16 floats, to be
1998 /// filled with a column-major homogenous transformation matrix, as used by
1998 /// filled with a column-major homogeneous transformation matrix, as used by
19991999 /// OpenGL.
20002000 void ArPose_getMatrix(const ArSession *session,
20012001 const ArPose *pose,
20752075 /// @param[in] session The ARCore session
20762076 /// @param[in] camera The session's camera.
20772077 /// @param[inout] out_col_major_4x4 Pointer to an array of 16 floats, to be
2078 /// filled with a column-major homogenous transformation matrix, as used by
2078 /// filled with a column-major homogeneous transformation matrix, as used by
20792079 /// OpenGL.
20802080 void ArCamera_getViewMatrix(const ArSession *session,
20812081 const ArCamera *camera,
21212121 /// @param[in] near Specifies the near clip plane, in meters
21222122 /// @param[in] far Specifies the far clip plane, in meters
21232123 /// @param[inout] dest_col_major_4x4 Pointer to an array of 16 floats, to
2124 /// be filled with a column-major homogenous transformation matrix, as used
2124 /// be filled with a column-major homogeneous transformation matrix, as used
21252125 /// by OpenGL.
21262126 void ArCamera_getProjectionMatrix(const ArSession *session,
21272127 const ArCamera *camera,
224224 /*
225225 * Retrieve external file directory through JNI call
226226 *
227 * return: std::string containing external file diretory
227 * return: std::string containing external file directory
228228 */
229229 std::string GetExternalFilesDir();
230230
211211 }
212212
213213 //----------------------------------------------------------
214 // Pinch controll
214 // Pinch control
215215 //----------------------------------------------------------
216216 void TapCamera::BeginPinch(const Vec2& v1, const Vec2& v2) {
217217 if (dragging_) EndDrag();
288288 }
289289
290290 //----------------------------------------------------------
291 // Trackball controll
291 // Trackball control
292292 //----------------------------------------------------------
293293 void TapCamera::BallUpdate() {
294294 if (dragging_) {
8989 {
9090 [super prepareOpenGL];
9191
92 // Application must be initialized befor display link is started
92 // Application must be initialized before display link is started
9393 [self initGL];
9494
9595 CVDisplayLinkRef displayLink;
147147 // cost of framerate and battery life due to the GPU needing to render more
148148 // pixels.
149149
150 // Any calculations the renderer does which use pixel dimentions, must be
150 // Any calculations the renderer does which use pixel dimensions, must be
151151 // in "retina" space. [NSView convertRectToBacking] converts point sizes
152152 // to pixel sizes. Thus the renderer gets the size in pixels, not points,
153153 // so that it can set it's viewport and perform and other pixel based
117117 // this controller (self)
118118 [self setWindow:[self standardWindow]];
119119
120 // Set the content of the orginal window to the view
120 // Set the content of the original window to the view
121121 [[self window] setContentView: [self fullscreenWindow].contentView];
122122
123123 // Show the window and make it the key window for input
8484 // Set it to our _animationFrameInterval
8585 [_displayLink setPreferredFramesPerSecond:_preferredFramesPerSecond];
8686
87 // Have the display link run on the default runn loop (and the main thread)
87 // Have the display link run on the default run loop (and the main thread)
8888 [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
8989
9090 [super startAnimation];
109109 /// Called by the framework to request the desired initial window size.
110110
111111 /// This method is called before the platform-specific window is created.
112 /// An application may override this method to speciy required initial
112 /// An application may override this method to specify required initial
113113 /// window width and height.
114114 virtual void GetDesiredInitialWindowSize(int& width, int& height)
115115 {
5555 public:
5656 /// Called when GL context is initialized
5757
58 /// An application must override this method to perform requred
58 /// An application must override this method to perform required
5959 /// initialization operations after OpenGL context has been initialized
6060 /// by the framework
6161 /// \param [in] display - XLib display.
7676 }
7777 #else
7878
79 # error Usnupported paltform
79 # error Usnupported platform
8080
8181 #endif
8282
5151 // Notifies the app that it is being suspended.
5252 virtual void OnSuspending() {}
5353
54 // Notifes the app that it is no longer suspended.
54 // Notifies the app that it is no longer suspended.
5555 virtual void OnResuming() {}
5656
5757 // Notifies renderers that device resources need to be released.
22 This module implements additional functionality on top of the [Diligent Engine](https://github.com/DiligentGraphics/DiligentEngine)'s core module
33 and contains the following libraries:
44
5 * [Texture loader](TextureLoader): a texture loading libary. The following formats are currently supported: jpg, png, tiff, dds, ktx.
6 * [Asset Loader](AssetLoader): an asset loading libary. The library currently supports GLTF 2.0.
5 * [Texture loader](TextureLoader): a texture loading library. The following formats are currently supported: jpg, png, tiff, dds, ktx.
6 * [Asset Loader](AssetLoader): an asset loading library. The library currently supports GLTF 2.0.
77 * To enable Draco compression, download [Draco repository](https://github.com/google/draco) and include it into
88 your project. Make sure that Draco source folder is processed by CMake *before* DiligentTools folder.
99 Alternatively, you can specify a path to the Draco installation folder using `DRACO_PATH` CMake variable.
4747 and you agree that the content is free of any Intellectual Property claims and you have the right to license it under those terms.
4848
4949 Diligent Engine uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to ensure
50 consistent source code style throught the code base. The format is validated by appveyor and travis
50 consistent source code style throughout the code base. The format is validated by appveyor and travis
5151 for each commit and pull request, and the build will fail if any code formatting issue is found. Please refer
5252 to [this page](https://github.com/DiligentGraphics/DiligentCore/blob/master/doc/code_formatting.md) for instructions
5353 on how to set up clang-format and automatic code formatting.
3333 /// PNG decoding result.
3434 DILIGENT_TYPED_ENUM(DECODE_PNG_RESULT, Uint32)
3535 {
36 /// Decoding was successfull.
36 /// Decoding was successful.
3737 DECODE_PNG_RESULT_OK = 0,
3838
3939 /// Invalid arguments (e.g. null pointer).
484484 case DXGI_FORMAT_BC7_UNORM: return TEX_FORMAT_BC7_UNORM;
485485 case DXGI_FORMAT_BC7_UNORM_SRGB: return TEX_FORMAT_BC7_UNORM_SRGB;
486486
487 default: UNEXPECTED( "Unsupported DXGI formate" ); return TEX_FORMAT_UNKNOWN;
487 default: UNEXPECTED( "Unsupported DXGI format" ); return TEX_FORMAT_UNKNOWN;
488488 }
489489 }
490490
618618 // No DXGI format maps to ISBITMASK(0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000) aka D3DFMT_X8B8G8R8
619619
620620 // Note that many common DDS reader/writers (including D3DX) swap the
621 // the RED/BLUE masks for 10:10:10:2 formats. We assumme
621 // the RED/BLUE masks for 10:10:10:2 formats. We assume
622622 // below that the 'backwards' header mask is being used since it is most
623623 // likely written by D3DX. The more robust solution is to use the 'DX10'
624624 // header extension and specify the DXGI_FORMAT_R10G10B10A2_UNORM format directly
158158 //Array of row pointers. One for every row.
159159 rowPtrs = malloc(sizeof(png_bytep) * pDstImgDesc->Height);
160160
161 //Alocate a buffer with enough space.
161 //Allocate a buffer with enough space.
162162 pDstImgDesc->RowStride = pDstImgDesc->Width * (Uint32)bit_depth * pDstImgDesc->NumComponents / 8u;
163163 // Align stride to 4 bytes
164164 pDstImgDesc->RowStride = (pDstImgDesc->RowStride + 3u) & ~3u;
168168 for (size_t i = 0; i < pDstImgDesc->Height; i++)
169169 rowPtrs[i] = pRow0 + i * pDstImgDesc->RowStride;
170170
171 //Read the imagedata and write it to the adresses pointed to
171 //Read the imagedata and write it to the addresses pointed to
172172 //by rowptrs (in other words: our image databuffer)
173173 png_read_image(png, rowPtrs);
174174