160 likes | 305 Views
NVIDIA APX 2500 Evaluation October 29, 2008. Overall Goals What we need to evaluate. Understand the layers [OPENKODE, OPENGL ES, NVIDIA Helper Libraries, Launcher] MVC – manipulation of View, Control and Data - create a simple list example to read data from the database or txt file
E N D
NVIDIA APX 2500 Evaluation October 29, 2008
Overall Goals What we need to evaluate • Understand the layers • [OPENKODE, OPENGL ES, NVIDIA Helper Libraries, Launcher] • MVC – manipulation of View, Control and Data • - create a simple list example to read data from the database or txt file • - extend the functionality of the list to add custom behaviors • OPENGL ES • - create simple demo using the NVIDIA framework
UI core presentation core input (motokeys, mototouch) core interactions + controls Applications & Services abstraction layer NVIDIA SDKParts and Pieces NVIDIA Helper Libraries 2D widgets OpenGL ES3D effects Integrated Contacts Contacts Detail View Connected Player Dash board Calendar Location Converse thru Content Moto Social Smart Search My Top5 What’s playing now Widgets core experiences Application logic using OpenKODE Core/NVIDIA Helper libraries native toolkit, applications + services native toolkit, applications + services native toolkit, applications + services Flows OpenKODE Core for file I/O or db connection Telephony Messaging Contacts Multimedia GPS/presence Data Sources All logic is written in C/C++ using NVIDIA Helper libraries and OpenKODE Core Libraries Operating System Hardware os h/w h/w os h/w os Any UI framework that interfaces with OpenKODE can be used to handle 2D widgets and logic.
NVIDIA SDKProgramming environment OPENKODE provides the basic C like functionality for event handling, variables, application initialization and cleanup etc. Functionality prefixed by “KD”. NVIDIA Helper Libraries provide a range of functionality from 2D UI framework, file input/output, OpenGL ES extensions. Functionality prefixed by “Nv”. OPENGL ES functions can be directly called and are prefixed by “gl”
Manipulation of View/Control List example • NVIDEA UI framework handles the rendering of all visible screen elements including backgrounds, bars, buttons, characters, and strings. • NvUIScrollPane, a subclass of the nv_ui library can be manipulated and manages the physics of gesture inputs, dragging/flicking, and touch-scrolling lists extending beyond the length of the screen. • NvUIRect can be used to change the area size and orientation of the list
Custom Functionality Two List example • NVIDIA UI Framework limitations for displaying two list views in landscape • Able to identify code to draw the list • Duplicating code block and changing some of the size parameters allowed for 2 lists • Issue1: Focus Control • Once focus is changed to 2nd list, unable to refocus on 1st list • Simple issue of not understanding how list gets focus • Issue2: Two Lists/controls side-by-side • When rotating lists to landscape view, they overlap each other • Unable to identify parameter to start 2nd list at different x-axis position
Manipulation of Data List example – read from TXT file • NVIDIA core app (Address Book) enables reading from various file formats & displaying to a list • Reading from Text file required altering NVIDIA code from “rb” read binary to “r” for text: fp = fopen(fileName, "r"); • Assign full path to data file and store it with project build • char* fileName = "d:\\Profiles\\w0438c\\Desktop\\nvap_sdk_0_3_x\\demos\\src\\addrbook\\ES2\\names.txt"; • Track the record count in the file: • contactDB = (NvContactRecord*)kdMalloc( • sizeof(NvContactRecord) * realNameCount); • Account for data fields in file. Every ‘%s’represents [i] fscanf(fp, "%s %s %s %s %s %s\n", contactDB[i].nameL, contactDB[i].nameF, contactDB[i].telH, contactDB[i].telM,contactDB[i].telW,contactDB[i].email);
Reading from text file #elif READ_TEXT_CONTACTS { KDint i; FILE *fp; char* fileName = "d:\\Profiles\\w0438c\\Desktop\\nvap_sdk_0_3_x\\demos\\src\\addrbook\\ES2\\names.txt"; try { fp = fopen(fileName, "r"); } catch (char * str) { nt dummy =0; } fscanf(fp, "%d\n", &realNameCount); contactDB = (NvContactRecord*)kdMalloc( sizeof(NvContactRecord) * realNameCount); // then strip data, and write back out immediately. for (i=0; i<realNameCount; i++) { memset(contactDB + i, 0, sizeof(NvContactRecord)); if (fp) { if (feof(fp)) { fclose(fp); fp = fopen("d:\\Profiles\\w0438c\\Desktop\\nvap_sdk_0_3_x\\demos\\src\\addrbook\\ES2\\names.txt", "r"); } fscanf(fp, "%s %s %s %s %s %s\n", contactDB[i].nameL, contactDB[i].nameF, contactDB[i].telH, contactDB[i].telM,contactDB[i].telW,contactDB[i].email);
Console SQL project #include "stdafx.h" using namespace System; using namespace System::Data; using namespace System::Data::SqlClient; //namespace test45 int main(int argc, char* argv[]) { using namespace std; int quit=0; while(quit != 1) { String^ strConnection = "Data Source=W0438C-05;Initial Catalog=Contacts;Integrated Security=True;Pooling=False"; SqlConnection^ myConnection = gcnew SqlConnection(strConnection); SqlDataAdapter^ adpProducts = gcnew SqlDataAdapter(); //adpProducts->TableMappings->Add(S"Table", S"Products"); SqlCommand^ cmdProducts = gcnew SqlCommand("SELECT * FROM ContactRecord", myConnection); adpProducts->SelectCommand = cmdProducts; DataSet^ ds = gcnew DataSet(); adpProducts->Fill(ds); int numRows = ds->Tables[0]->Rows->Count; int numItems = ds->Tables[0]->Rows[0]->ItemArray->Length; for (int c=0; c<numRows; c++) { for (int a=0; a<numItems; a++) { //play with this line to get the data to display Console::Write(ds->Tables[0]->Rows[c]->ItemArray[a]); //Console::WriteLine(ds->Tables[0]->Rows[c]->ItemArray->Length ); } Console::WriteLine(""); } cin >> quit; } } Connection string: String^ strConnection = "Data Source=W0438C-05;Initial Catalog=Contacts;Integrated Security=True;Pooling=False"; Query:SqlCommand^ cmdProducts = gcnew SqlCommand("SELECT * FROM ContactRecord", myConnection);
OPENGL ES Example using NVIDIA Helper Libraries • Start with basic triangle project from nVidia • By increasing the number of triangles, we were able to create a cube • Shader provided didn’t allow for z-axis movement Vertices to draw triangles from Offset for each triangle Color blending at each vertex
OPENGL Exploration • Explore basic openGL concepts • Create pyramid and cubes • Able to show depth • Able to rotate on x,y,and z axis
Launcher 3 example applications • A Compositor GUI in the OpenKODE window manager system running applications as standalone windows or rendered as panes in a compositing 3D UI • Assignment of NVIDEA core and custom applications to Launcher panes • Addition of custom apps to specific windows within the Launcher (using APP_ID) Created our own custom Open GL ES app using the NVIDEA helper libraries and assigned it to a specific window in the Launcher One-Line List Example: NVIDEA Core app reading our text data Two-Line List Example: NVIDEA Core app reading our text data Launcher can be customized, and resized… but it’s primary function is window management
Launcher 3 example applications Assign your custom application to a specific launcher pane. Apply an ID to your custom app which will be read by the launcher, and assigned to the appropriate position in the spinner… All custom apps are defined as having an unknown APP_ID Sets the APP_ID to the number specified in the launcher configuration file
Launcher 3 example applications Add the appropriate path and AppID to the launcher config.txt file Include relative path to your custom app location. Core nvidea apps are all stored in their own folder Apply custom APP_ID to the appropriate panel position on the spinner
Launcher 3 example applications The launcher_def.h file is where all APP_ID numbers are reserved. Custom app ID’s need to be added… Reserved ID’s for nvidea core apps. Custom APP_ID’s start at 1024