  We study theoretically resonant inelastic x-ray scattering (RIXS) at the Cu
$L_3$-edge in a typical parent compound of high-$T_c$ cuprate superconductors
La$_2$CuO$_4$ on the basis of a detailed electronic band structure. We
construct a realistic and precise tight-binding model by employing the
maximally-localized Wannier functions derived from a first-principles
electronic structure calculation, and then take account of the Coulomb
repulsion between d electrons at each Cu site. The antiferromagnetic ground
state is described within the Hartree-Fock approximation, and take account of
electron correlations in the intermediate states of RIXS within the
random-phase approximation (RPA). Calculated RIXS spectra agree well with the
experimentally observed features including low-energy magnon excitation,
$d$-$d$ excitations, and charge-transfer excitations, over a wide
excitation-energy range. In particular, we stress the importance of photon
polarization dependence: the intensity of magnon excitation and the spectral
structure of $d$-$d$ excitations depend significantly not only on the
polarization direction of incident incoming photons but also that of outgoing
photons. It is demonstrated that the single-magnon excitation intensity is
maximized when the polarization directions of incoming and outgoing photons are
perpendicular to each other.
