3D Graphics with OpenGL ES and M3G- P31

3D Graphics with OpenGL ES and M3G- P31:Mobile phones are the new vehicle for bringing interactive graphics technologies to consumers. Graphics that in the 1980s was only seen in industrial flight simulators and at the turn of the millennium in desktop PCs and game consoles is now in the hands of billions of people. This book is about the technology underpinnings of mobile threedimensional graphics, the newest and most rapidly advancing area of computer graphics. | 284 INTRODUCING M3G CHAPTER 12 reason is the lack of typedef in Java there is no efficient way to define a fixed data type to distinguish fixed-point values from ordinary int variables. Without this capability fixed-point code becomes even more unreadable and error-prone than otherwise. Finally the benefit of doing fixed-point arithmetic may not be as great in Java as in native code because you cannot use assembly language and because the extra bit-shifting requires more bytecodes than the corresponding float operations. See the Java section in Appendix A for more information. ENUMERATIONS As the Java programming language has no support for enumerations they are represented as constant integer values . static final int . Enumerations are defined in the class where they are needed and do not apply anywhere else. For example the RGB pixel format token in Image2D has the decimal value 99 and is the only token in the API having that particular value. Having to prefix all enumerations by their class name is cumbersome but if you need a particular enumeration very often you can copy it into a local variable or instance variable like this int REPEAT REPEAT REPEAT REPEAT REPEAT ERROR HANDLING As in any proper Java API error handling in M3G is based on the built-in exception mechanism. Thanks to exceptions no methods in the API need to return error codes or set internal error flags that the application would have to check separately. There are seven different types of exceptions the API may throw roughly indicating the type of error. The exceptions are listed in Table . M3G is generally more stringent about error checking than OpenGL ES. For example indexing a vertex array out-of-bounds has undefined effects in OpenGL ES but causes a well-defined exception in M3G. The extra error checking may have a minor impact on performance but it also makes debugging easier and the .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
27    303    2    26-06-2024
163    85    2    26-06-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.